narrav
asked on
problem in javascript
Hey all,
may be somebody can help me with this..
Just have 3 textboxes...
<FORM name='myform' action='#'>
<INPUT type='text' name='month' size='10' maxlength='10'>
<INPUT type='text' name='day' size='10' maxlength='10' >
<INPUT type='text' name='year' size='10' maxlength='10'>
</form>
I am trying to find a way to know which element has my focus -- in javascript..
is there anything like isfocus in javascript...???
help me with this pls..
regards
may be somebody can help me with this..
Just have 3 textboxes...
<FORM name='myform' action='#'>
<INPUT type='text' name='month' size='10' maxlength='10'>
<INPUT type='text' name='day' size='10' maxlength='10' >
<INPUT type='text' name='year' size='10' maxlength='10'>
</form>
I am trying to find a way to know which element has my focus -- in javascript..
is there anything like isfocus in javascript...???
help me with this pls..
regards
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
var isfocused = null;
</script>
<FORM name='myform' action='#'>
<INPUT type='text' name='month' size='10' maxlength='10' onFocus='isfocused=this;'>
<INPUT type='text' name='day' size='10' maxlength='10' onFocus='isfocused=this;'>
<INPUT type='text' name='year' size='10' maxlength='10' onFocus='isfocused=this;'>
</form>
now at any time you wish to know which element has focus, simply do this:
if ( isfocused )
alert( isfocused.name );