xxxxxxxxxx
19
function setup() {
createCanvas(400, 400);
// Create a dom element
let domInputElt = createInput("hello");
// Print out the p5.Element input object
console.log(domInputElt);
// Hook up an event listener that will call the process function when someone types in the input field
domInputElt.input(process)
}
function draw() {
background(220);
}
function process() {
//console.log(this);
// "this" is the p5.Element object that represents the input field
console.log(this.value());
}