My code is designed to set the width of my progress bar by calculating the percentage and passing it as a style.width. I am a novice, so apologise for the bad code:
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>
Could someone with a second to spare please help me to get it working and show me where I’ve gone wrong so I can learn from this?
The string
'=width + "%"'can’t be the value of a css parameter.You probably wanted