Dynamic input replace in JQuery - Javascript jQuery

Javascript examples for jQuery:Form Input

Description

Dynamic input replace in JQuery

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-git.js"></script> 
  <script type="text/javascript">
    $(window).on('load', function() {
$(function(){//from ww  w  .j a  v a2 s . com
    $("input").keyup(function(){
       var $this = $(this);
        if ($this.val().indexOf("=")>=0){
           $this.val(eval($this.val().replace("=", "").replace("x","*")));
        }
    });
});
    });

      </script> 
 </head> 
 <body> 
  <input type="text">  
 </body>
</html>

Related Tutorials