<body>
<input type="text" id="keys">
<script>
var forbidden = /[\!\@\#\$\%\^\&\*\(\)]/g;
var field = document.getElementById('keys');
field.addEventListener("keyup", function (evt) {
var val = field.value;
if (forbidden.test(val)) {
field.value = val.replace(forbidden, "");
}
}, false);
</script>
</body>