File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed
Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -237,19 +237,36 @@ p5.Element.prototype.mouseOver = function (fxn) {
237237
238238
239239/**
240- * The .changed() function is called when the value of an element is changed.
240+ * The .changed() function is called when the value of an
241+ * element is changed.
241242 * This can be used to attach an element specific event listener.
242243 *
243244 * @method changed
244- * @param {Function } fxn function to be fired when mouse is
245- * moved over the element.
245+ * @param {Function } fxn function to be fired when the value of an
246+ * element changes .
246247 * @return {p5.Element }
247248 */
248249p5 . Element . prototype . changed = function ( fxn ) {
249250 attachListener ( 'change' , fxn , this ) ;
250251 return this ;
251252} ;
252253
254+ /**
255+ * The .input() function is called when any user input is
256+ * detected with an element. The input event is often used
257+ * to detect keystrokes in a input element, or changes on a
258+ * slider element. This can be used to attach an element specific
259+ * event listener.
260+ *
261+ * @method input
262+ * @param {Function } fxn function to be fired on user input.
263+ * @return {p5.Element }
264+ */
265+ p5 . Element . prototype . input = function ( fxn ) {
266+ attachListener ( 'input' , fxn , this ) ;
267+ return this ;
268+ } ;
269+
253270/**
254271 * The .mouseOut() function is called once after every time a
255272 * mouse moves off the element. This can be used to attach an
You can’t perform that action at this time.
0 commit comments