getting html element name, javascript function |
getting html element name, javascript function |
kryles |
Jan 18 2008, 01:41 PM
Post
#1
|
Novice Group: Members Posts: 21 Joined: 30-November 07 Member No.: 4,437 |
Hi,
I just want to test which textbox the user is filling in. I think I'll use an onkeyup function call from the textbox, but how do I check the name of the textbox with focus? I was thinking something along these lines but it doesn't seem to work (no message) CODE /* JS */ function focusField(curEl) { var current_ele = curEl; alert("here"); if(current_ele.Name() == "Fname") alert("yay!"); } <!-- html --> <input type="text" name="Fname" id="Fname" value="" onkeyup="focusField(this);"> <!-- pass element makign call --> |
Lo-Fi Version | Time is now: 17th April 2024 - 04:48 PM |