Managing value attribute of progress tag by button click
We have seen how HTML5 progress tag is used to display status of a process. Here we will learn how to manage attributes of progress tag using JavaScript.
Linking value attribute to button click.
We will keep one button and onClick event of the button will trigger a function. The function will increase the value of progress tag by 10.
Displaying Progress Bar
HTML5 gives us this tag and by using this we can create a progress bar.
This progress bar has two main attributes. One is value and other one is maximum attribute. We can read the present value of the progress bar and we can set them to a new value.
Button onClick
We will display the button and onClick of the button we will execute the JavaScript function incr();
You can try to add one more button to decrease the value and also display a message saying end of the process ( when value equals to Max attribute )
← Subscribe to our YouTube Channel here