I want to call an onblur
on div
. Not sure how to get it done.
Tried this:
div onblur="javascript:callme()"
but it didn't work
See Question&Answers more detail:osI want to call an onblur
on div
. Not sure how to get it done.
Tried this:
div onblur="javascript:callme()"
but it didn't work
See Question&Answers more detail:osFor blur
event to fire on an element, the element needs to receive focus first. But <div>
elements do not receive focus by default.
You can add tabindex="0"
or contentEditable
to your div so it will receive focus.
See it in action: http://jsfiddle.net/t25rm/