Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

accesing document elements not having a form

 
alec stewart stewart
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic