1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00
elinks/test/ecmascript/assert/keyboardEvent.html

14 lines
452 B
HTML
Raw Normal View History

<script>
var e = new KeyboardEvent('message', { cancelable: true, key: "Enter" });
console.error('keyboardEvent.html');
console.assert(e.cancelable, 'cancelable true');
console.assert(!e.defaultPrevented, 'false');
e.preventDefault();
console.assert(e.defaultPrevented, 'true');
console.assert(e.type === 'message', 'message');
console.assert(e.key === 'Enter', 'key Enter');
console.assert(e.keyCode === 13, 'ENTER = 13');
console.exit(0);
</script>