Answers for ".change() in pure js"

0

.change() in pure js

/* event listener */
document.getElementsByName("Thing")[0].addEventListener('change', doThing);

/* function */
function doThing(){
   alert('Horray! Someone wrote "' + this.value + '"!');
}
Posted by: Guest on April-11-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language