Disallow typing of few of characters e.g.'<', '>' in all input textboxes using jquery

后端 未结 3 639
粉色の甜心
粉色の甜心 2021-01-24 01:58

How do I achieve this:-
When user types character like \'abcd\' and then \'>\'(an invalid character for my application), I wan

3条回答
  •  滥情空心
    2021-01-24 02:21

    $('#textBox').keyup(function(e){
                var myText = $('#textBox').val(); 
                myText =  myText.replace(">", "");
                myText =  myText.replace("<", "");
                $('#textBox').val(myText);
            });
    

    -- Update --

    keyup instead keypress

提交回复
热议问题