Bootstrap: Progress Bar And Receiving Data From The User
this is going to be very basic question. What I'm trying to do is to have simple progress bar and a way to receive number from the user. Then I want my code to start when user clic
Solution 1:
You are adding quotes to the width which is wrong.You should add the value without the quotes.
Note that you are changing the width of the div. In order to see the current progress you could add some background color to the div with id prog.
var moveBar = function() {
var addPoints = prompt("Select amount:");
// Prompt and ask user for inputvar bars = document.getElementsByClassName("progress-bar");
bars[0].style.width = parseInt(addPoints) + "%";
//console.log(parseInt(addPoints) + "%"); // Added for testing. Displays correct value, but code doesn't work.
}
Post a Comment for "Bootstrap: Progress Bar And Receiving Data From The User"