Skip to content

Commit 78e9152

Browse files
Create censored_keyboard_completejavascript.com.js
1 parent 9048cd5 commit 78e9152

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<input type="text">
2+
<script>
3+
var field = document.querySelector("input");
4+
// Your code here.
5+
field.addEventListener('keypress', function(event) {
6+
var key = String.fromCharCode(event.charCode);
7+
if(/[qwx]/i.test(key)) {
8+
event.preventDefault();
9+
}
10+
});
11+
</script>

0 commit comments

Comments
 (0)