Am trying to work out a fee progress bar. I have calculated the percentage of the width of the progress with JavaScript and it's a variable z. So I am trying to style the element with the variable z and it's not working when I add % to it. Here is my code:
<html>
<body>
<div class="mybar">
<div class="myprogress" id="progress">
</div>
</div>
<script>
window.onload=function(){
var fee=document.getElementById("fee").innerHTML;
var bill=document.getElementById("bill").innerHTML;
var y=(fee/bill);
var z=(y*100);
document.getElementById("progress").style.width="z%";
}
</script>
</body>
</html>