📑 Creates an input element.
Use the value property to get or set the input's value.
value
Use the placeholder property to set label text that appears inside the input when it's empty.
placeholder
See MDN's input documentation for the full list of input types.
Optional
initial value
text input type, can be 'text', 'password', 'email', 'number', 'range', 'search', 'tel', 'url'
await Canvas(200, 100);textSize(64);let input = createInput();input.placeholder = 'Type here!';input.size(200, 32);input.addEventListener('input', () => { background('orange'); text(input.value, -90, 30);}); Copy
await Canvas(200, 100);textSize(64);let input = createInput();input.placeholder = 'Type here!';input.size(200, 32);input.addEventListener('input', () => { background('orange'); text(input.value, -90, 30);});
📑 Creates an input element.
Use the
valueproperty to get or set the input's value.Use the
placeholderproperty to set label text that appears inside the input when it's empty.See MDN's input documentation for the full list of input types.