My goal is to dynamically set the width of my progress bar based on a calculated percentage. As a beginner, I admit that my code may not be optimal:
JQuery
$(document).ready(function() {
var width=(1/5*100);
$('#progress_bar').css('width','=width + "%"');
});
HTML
<div id="progress_bar" style="height:1em; background:red; display:block;"></div>
I would greatly appreciate some help from anyone who has a moment to spare in getting this code to work correctly and pointing out any mistakes for me to learn from.