...

View Full Version : Help with element focus detection



Kerdek
02-14-2007, 01:45 AM
So, i have a <div> containing an <input>, right?
Now what i need to do is make a onmouseover function for the <div>,
it doesn't matter what the function DOES, but i want an "if" statement in the function that will detect whether or not the <input> has focus.

Anybody know how?

chump2877
02-14-2007, 03:45 AM
i want an "if" statement in the function that will detect whether or not the <input> has focus.Why do you want to detect if the input has focus? Usually, you either need to give focus to something, i.e.:


document.getElementById('yourInput').focus();..or you want to remove focus from something:


document.getElementById('yourInput').blur();



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum