Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript disable enter key

<script type="text/javascript">
window.addEventListener('keydown',function(e){if(e.keyIdentifier=='U+000A'||e.keyIdentifier=='Enter'||e.keyCode==13){if(e.target.nodeName === 'INPUT' && e.target.type !== 'textarea'){e.preventDefault();return false;}}},true);
</script>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #disable #enter #key
ADD COMMENT
Topic
Name
2+5 =