Skip to content

Commit 2d00990

Browse files
authored
Merge pull request #2492 from aharpole/master
adding example code for using the elt property on p5.Element
2 parents c9df78b + 2e3ce61 commit 2d00990

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/core/p5.Element.js

+12
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ var p5 = require('./core');
2626
p5.Element = function(elt, pInst) {
2727
/**
2828
* Underlying HTML element. All normal HTML methods can be called on this.
29+
* @example
30+
* <div>
31+
* <code>
32+
* createCanvas(300, 500);
33+
* background(0, 0, 0, 0);
34+
* var input = createInput();
35+
* input.position(20, 225);
36+
* var inputElem = new p5.Element(input.elt);
37+
* inputElem.style('width:450px;');
38+
* inputElem.value('some string');
39+
* </code>
40+
* </div>
2941
*
3042
* @property elt
3143
* @readOnly

0 commit comments

Comments
 (0)