Set Progress bar width - Javascript jQuery

Javascript examples for jQuery:Width Height

Description

Set Progress bar width

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){/*w  w w .j  a  va 2  s  .  co  m*/
$(document).ready(function() {
var width=(1/5*100);
$('#progress_bar').css('width', width + "%");
});
    });

      </script> 
 </head> 
 <body> 
  <div id="progress_bar" style="height:1em; width:1%; background:red;"></div>  
 </body>
</html>

Related Tutorials