vivek vijayakumar vivek vijayakumar - 4 months ago 40
Javascript Question

block this special characters using query `~ #$^+|\ []{}<>

I want to block some special characters from entering in text box.
`~ #$^+|\ []{}<> these are the characters i would like to prevent from user inputting. Can any one suggest a solution or reg ex.


function some(){
var input = document.getElementById('one').value;
var one = input.replace(/[(\\^`~#\$\^\+\|\\\[\]{}<>)]/g,"");
 <input type="text" oninput="some()" id="one"  >