I have a field and want to prevent some illegal characters while showing the user as he types. How can I do this in follow example?
$(\'input\').bind(\"change
Give this a try. No array, though.
$('input').bind("change keyup", function() { var $th = $(this); $th.val( $th.val().replace(/["<>&]/g, function(str) { return ''; } ) ); });