Onkeyup on div


i’m runnning ff 1.0.4.

i set up a onkeyup event on div element but for some reason the handler is never triggered with ff.(in ie it works when i give focus to div by clicking on it)

i searched the net for this issue and some people say that this is correct behaviour because div’s can’t have focus and so don’t recieve keyboard events.

various html references i looked through claim that onkeyup is one of standart events that almost every html element supports.

So is it some ff bug or div’s and as such really can’t handle keyboard events?

Focus is not available to a div in most browsers, IE being an exception. You can still trap the onkey events through the body or form elements, which do support focus.

if i hide input element inside div will this help?

I’m not sure how the input element could receive focus if it is hidden.