How do I achieve this:- When user types character like \'abcd\' and then \'>\'(an invalid character for my application), I wan
\'abcd\'
\'>\'
$('#textBox').keyup(function(e){ var myText = $('#textBox').val(); myText = myText.replace(">", ""); myText = myText.replace("<", ""); $('#textBox').val(myText); });
-- Update --
keyup instead keypress
keyup
keypress