document.addEventListener('DOMContentLoaded', function () {
var inputField = document.querySelector('input.some_text_field');
inputField.addEventListener('keydown', function (e) {
if (e.keyCode === 32) {
return false;
}
});
}());
Pure JS rewrite of: https://codepad.co/snippet/aa2fb8
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.