<!DOCTYPE html>
<html>
<body>
<p>A function is triggered when the user is pressing a key in the input field.</p>
<input type="text" onkeydown="myFunction(event)">
<script>
function myFunction(event)
{
console.log(Object.keys(event))
console.log(event)
}
</script>
</body>
</html>
I run above code in: https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onkeydown I expect get all KeyboardEvent object properties that documented in MDN: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent
My goal is to get the property of the difference between two objects in javascript to compare two KeyboardEvent objects, but the linked solution does not work for the KeyboardEvent object, Object.keys(KeyboardEvent)
only get one "isTrusted" key rather than all keys.