I want to call an onblur on div. Not sure how to get it done.
onblur
div
Tried this:
div onblur="javascript:callme()"
but it didn't work
For blur event to fire on an element, the element needs to receive focus first. But <div> elements do not receive focus by default.
blur
<div>
You can add tabindex="0" or contentEditable to your div so it will receive focus.
tabindex="0"
contentEditable
See it in action: http://jsfiddle.net/t25rm/
2.1m questions
2.1m answers
60 comments
57.0k users