Prevent @ to be entered into input field - Javascript jQuery

Javascript examples for jQuery:Form Input

Description

Prevent @ to be entered into input field

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   w w  w.j  a  va  2  s.  c  o  m*/
  $(document).on('keypress', '[placeholder="x"]', function(event) {
     if(event.which === 64){
       return false;
    }
  });
})
    });

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

Related Tutorials