Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

input element change event data

const selectElement = document.querySelector('.ice-cream');

selectElement.addEventListener('change', (event) => {
  const result = document.querySelector('.result');
  result.textContent = `You like ${event.target.value}`;
});
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #input #element #change #event #data
ADD COMMENT
Topic
Name
8+5 =