Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

addeventlistener input

// to get value from text input (or textarea):
// in html:
<input class="my-class">type something here with console opened</input>
// in js:
const myInputArea = document.querySelector(".my-class")
myInputArea.addEventListener("input", (e)=>{
  const myInputText = e.target.value
  console.log(myInputText)
})
                                                 
 
PREVIOUS NEXT
Tagged: #addeventlistener #input
ADD COMMENT
Topic
Name
8+8 =