Calculate percentage - Javascript jQuery

Javascript examples for jQuery:Variable

Description

Calculate percentage

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://code.jquery.com/jquery-compat-git.js"></script> 
      <script type="text/javascript">
    $(window).on('load', function() {
$("#val").on('keyup', function(){
    $("#incPerc").text(parseInt($(this).val())*1.08);
});/*w  w  w  .j a  v a  2  s. c  o m*/
    });

      </script> 
   </head> 
   <body> 
      <input id="val" value="100"> 
      <span id="incPerc"></span>  
   </body>
</html>

Related Tutorials