@@ -74,8 +74,18 @@ var p5DOM = (function(){
74
74
* Removes all elements created by p5, except any canvas / graphics
75
75
* elements created by createCanvas or createGraphics.
76
76
* Event handlers are removed, and element is removed from the DOM.
77
- *
78
77
* @method removeElements
78
+ * <div class='norender'><code>
79
+ * function setup() {
80
+ * createCanvas(100, 100);
81
+ * createDiv('this is some text');
82
+ * createP('this is a paragraph');
83
+ * }
84
+ * function mousePressed() {
85
+ * removeElements(); // this will remove the div and p, not canvas
86
+ * }
87
+ * </code></div>
88
+ *
79
89
*/
80
90
p5 . prototype . removeElements = function ( e ) {
81
91
for ( var i = 0 ; i < this . _elements . length ; i ++ ) {
@@ -280,7 +290,12 @@ var p5DOM = (function(){
280
290
* Creates an HTML5 <video> element in the DOM for simple playback
281
291
* of audio/video. Shown by default, can be hidden with .hide()
282
292
* and drawn into canvas using video(). Appends to the container
283
- * node if one is specified, otherwise appends to body.
293
+ * node if one is specified, otherwise appends to body. The first parameter
294
+ * can be either a single string path to a video file, or an array of string
295
+ * paths to different formats of the same video. This is useful for ensuring
296
+ * that your video can play across different browsers, as each supports
297
+ * different formats. See <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats">this
298
+ * page for further information about supported formats.
284
299
*
285
300
* @method createVideo
286
301
* @param {String|Array } src path to a video file, or array of paths for
@@ -302,7 +317,12 @@ var p5DOM = (function(){
302
317
/**
303
318
* Creates a hidden HTML5 <audio> element in the DOM for simple audio
304
319
* playback. Appends to the container node if one is specified,
305
- * otherwise appends to body.
320
+ * otherwise appends to body. The first parameter
321
+ * can be either a single string path to a audio file, or an array of string
322
+ * paths to different formats of the same audio. This is useful for ensuring
323
+ * that your audio can play across different browsers, as each supports
324
+ * different formats. See <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats">this
325
+ * page for further information about supported formats.
306
326
*
307
327
* @method createAudio
308
328
* @param {String|Array } src path to an audio file, or array of paths for
@@ -657,8 +677,12 @@ var p5DOM = (function(){
657
677
658
678
/**
659
679
* Removes the element and deregisters all listeners.
660
- *
661
680
* @method remove
681
+ * @example
682
+ * <div class='norender'><code>
683
+ * var myDiv = createDiv('this is some text');
684
+ * myDiv.remove();
685
+ * </code></div>
662
686
*/
663
687
p5 . Element . prototype . remove = function ( ) {
664
688
// deregister events
0 commit comments