I have html document. In that document I have some code that looks like the following: <tr> <td>Name:</td> <td> <div class="Data" id="login_name"> <input type=text></input> </div> </td> </tr> The user enters in their login name (and their password in another input box not shown here) and presses a button on the page that says "login". The button has onclick="login(); function. In "login()" to access what the user entered in the input box by accessing the DOM tree. Here is what I am doing right now. // the login is actually a var that can contain the login // name or password. This returns an object var element = document.getElementById("login_name"); // child = INPUT, which it should var child = element.firstChild.nodeName; [don't know what the next line here should be] What I am trying to do is access is the value a user types into the input box. I can look at the DOM tree and see: + DIV = Name IV Type:ELEMENT_NODE Att:class=Data,id=login_name INPUT - Name:INPUT Type:ELEMENT_NODE Att: value=bob note that the user here types bob in thee login text area. I've tried various ways to access this "bob" value but cannot find the correct method. I will need to be able to read/write this text area. Should I change my actual HTML and put XML tags around the <input type=text></input> to something like <LOGINNAME><input type=text></input></LOGINNAME> and this will create a way to access the value in the input box? Any help would be appreciated. Thanks in advance, Joe Crew [ Ajith disabled smilies in the post so that the colon prefixed characters are not interpreted as UBB images ] [This message has been edited by Ajith Kallambella (edited April 26, 2001).]
Mapraputa, You were 100% correct in your response. Thank you so very much. I am kind of new to this so I did kind of asked the question incorrectly. But you saw through it and gave me the correct answer anyway. You were right in that it was not XML but just a DOM tree itself, and I was just trying to access the value in an input box. Thanks again, Joe Crew
Joe, thank you for asking! When we approach a new field it is difficult even to formulate the problem, so do not worry about �incorrect� questions. We all learn here and �incorrectly asked� question are the most useful (at least, for those who answer ). I remember somebody here said that �ill-defined� questions are more useful than �well-defined�, because they make us actually think, instead of just rearranging words. That what I felt answering college tests - often it is possible to answer by repeating words, without understanding what I am saying - qustions are too correct!