Skip to content
Advertisement

How do I set a progress bar value by text-type input?

I am developing an application where the user has to input a name and then there is a progress bar that must be set the value in the input text type (or numeric type). I want the progress bar to automatically have that value.

I used this HTML code:

JavaScript

and my javascript code is :

JavaScript

Advertisement

Answer

it better to add the data using one function so it easy to validate and doesn’t require element ID.

You can’t use document.getElementById("score").value because its not <progress> tag, use attribute style="width: 50%".

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement