3 <script type="text/javascript">
4 window.onload = function() {
5 document.getElementById('test').addEventListener('keypress', function(e) {
6 out = document.getElementById('out');
7 out.innerHTML = 'keyCode: ' + e.keyCode + ' (should be 13)';
9 out.style.background = '#6f6';
11 out.style.background = '#f66';
13 document.getElementById('test').focus()
18 <p>Press the numpad Enter key while the input box below is focused:</p>
19 <p><input type="text" id="test" /></p>