Reference createInput()

createInput()

Creates a text <input> element.

Call myInput.size() to set the length of the text box.

The first parameter, value, is optional. It's a string that sets the input's default value. The input is blank by default.

The second parameter, type, is also optional. It's a string that specifies the type of text being input. See MDN for a full list of options. The default is 'text'.

Examples

Syntax

createInput([value], [type])
createInput([value])

Parameters

value
String:

default value of the input box. Defaults to an empty string ''.

type
String:

type of input. Defaults to 'text'.

Returns

p5.Element: new p5.Element object.
This page is generated from the comments in src/dom/dom.js . Please feel free to edit it and submit a pull request!

Related References