By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,187 Members | 1,069 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,187 IT Pros & Developers. It's quick & easy.

access elements inside <div> tag

P: n/a
This is probably very simple question but how do you access elements
inside the <div> tag?

I need to access the value of a textfield inside a <div> tag.

Thanks.
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Kenneth wrote:
This is probably very simple question but how do you access elements
inside the <div> tag?

I need to access the value of a textfield inside a <div> tag.

Thanks.


Whether your text field is inside a <div> tag or not is probably not
relevant to how you access it.

If the text field is in a form, you can get access to it from the
forms collection. If it's not in a form, give it an ID and use
getElementById. A quick search of this news group on:

"document.forms[" or "document.getElementById"

will turn up hundreds of examples.

You could also use getElementsByTagName, but I suspect one of the
above methods will be better.
--
Rob
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.