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