For example,
<div onkeydown='alert(3)' style="background:yellow;height:300px;width:300px;"> Click at me first. and press a key to see the event </div>
Here is a jsfiddle example
Advertisement
Answer
You can specify the tabindex on it.
For example,
<div onkeydown='alert(3)' tabindex="0" style="background:yellow;height:300px;width:300px;"> Click at me first. and press a key to see the event </div>