This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes accesing document elements not having a form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "accesing document elements not having a form" Watch "accesing document elements not having a form" New topic
Author

accesing document elements not having a form

alec stewart stewart
Ranch Hand

Joined: Dec 23, 2003
Posts: 71
i have an html document consisting of text box .
now how do i access the text box. the html document doesn't have a form element.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15379
    
    6
some browser are not going to likr that the form tag is missing, but you should be able to access it with
var theVal = document.getElementById("TheName").value;
Eric
 
 
subject: accesing document elements not having a form