By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,238 Members | 1,661 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,238 IT Pros & Developers. It's quick & easy.

Do DIVs have a onblur handler?

P: n/a
Hi,

What handler would I set on a particular DIV if a user mouses out of
that DIV or clicks outside of that DIV?

Thanks, - Dave

Oct 23 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I usually try onfocus and onblur if i want to catch clicks out side a
div.

Oct 25 '07 #2

P: n/a
caglaror wrote:
I usually try onfocus and onblur if i want to catch clicks out side a
div.
As not all elements can be focused, the `focus' and `blur' events do not
apply to all elements. In fact, per W3C DOM Level 2 Events those events
only apply to LABEL, INPUT, SELECT, TEXTAREA, and BUTTON (that may be
different in other DOMs); HTML 4.01 specifies the `onfocus' and `onblur'
attributes only for A, AREA, BUTTON, INPUT, LABEL, SELECT, and TEXTAREA.
So you would need such an element "out side the div".

I guess that is why the OP asked in the subject whether or not "DIVs have
a onblur handler" ...
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Oct 25 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.