Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js get html input range value

//If you listen for the change event, the function will run only when the mouse is released. That means it won't run while dragging.
//If you listen for the input event, the function will run even while dragging.

const price_range_input = document.querySelector('#range');

price_range_input.addEventListener('input',e=>{
  const price_value = document.querySelector('.price_range_value');
  price_value.innerHTML = e.target.value;
})
 
PREVIOUS NEXT
Tagged: #js #html #input #range
ADD COMMENT
Topic
Name
7+8 =