Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

56
Views
Add event handler to HTML Progress tag

I´m trying to assign an event handler for a HTML tag, I want to fire a function when the value changes, but none events are fired..

<progress
   id="side-cart__progress-bar" 
   class="side-cart__progress-bar"
   first-gift="{{ section.settings.product_1_progress_bar.id }}"
   first-goal="{{ first_goal }}"
   second-gift="{{ section.settings.product_2_progress_bar.id }}"
   second-goal="{{ second_goal }}"
   final-gift="{{  section.settings.product_3_progress_bar.id}}" 
   max="{{ final_goal }}" 
   value="{{ cart.total_price }}"
  >
</progress>

Here's my JS:

const $sideCartProgressBar = document.querySelector("#side-cart__progress-bar")

$sideCartProgressBar.addEventListener("change", function(){
   console.log('Hello')
}) 
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

<progress> does not support a change event listener. In addition, as far as I know, it raises no event when you change its value.

You can see, for example, MDN documents the existence of the change event on <select> but there is no similar documentation of change event on <progress>, supporting my claim that there is no such event for <progress>. In fact, there are no documented events for <progress> at all (besides inherited DOM events).

You should find some other way to do this, such as modifying the code which updates cart.total_price to do something extra when final_goal is reached.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!