Re: FAQ Topic - How do I get the value of a form control? (2009-06-19)
- From: kangax <kangax@xxxxxxxxx>
- Date: Mon, 22 Jun 2009 12:22:58 -0400
Thomas 'PointedEars' Lahn wrote:
[...]
How do I get the value of a form control?
Correct answers include:
"Form controls can be referred to in different ways, depending on
the context of the reference and the location of the target control.
The following ways are fully standards-compliant (the proprietary `document'
property serves as a starting point for the implementation). Nevertheless,
you should perform run-time feature-tests prior to calling these methods as
not all browsers implement all standards.
1. Referring to a control that is not located within a form, is located
in the same form or in another form:
By ID: document.getElementById("...") [DOM3Core]
By name: document.getElementsByName("...")[...] [DOM2HTML]
By element type: document.getElementsByTagName("...")[...] [DOM3Core]
By XPath: document.evaluate("...")... [DOMXPath]
By CSS selector: document.querySelectorAll("...")[...] [Selector]
[...]
--
kangax
.
- Follow-Ups:
- Re: FAQ Topic - How do I get the value of a form control? (2009-06-19)
- From: Thomas 'PointedEars' Lahn
- Re: FAQ Topic - How do I get the value of a form control? (2009-06-19)
- References:
- FAQ Topic - How do I get the value of a form control? (2009-06-19)
- From: FAQ server
- Re: FAQ Topic - How do I get the value of a form control? (2009-06-19)
- From: Dr J R Stockton
- Re: FAQ Topic - How do I get the value of a form control? (2009-06-19)
- From: Garrett Smith
- Re: FAQ Topic - How do I get the value of a form control? (2009-06-19)
- From: Dr J R Stockton
- Re: FAQ Topic - How do I get the value of a form control? (2009-06-19)
- From: Garrett Smith
- Re: FAQ Topic - How do I get the value of a form control? (2009-06-19)
- From: Thomas 'PointedEars' Lahn
- Re: FAQ Topic - How do I get the value of a form control? (2009-06-19)
- From: Garrett Smith
- Re: FAQ Topic - How do I get the value of a form control? (2009-06-19)
- From: Thomas 'PointedEars' Lahn
- Re: FAQ Topic - How do I get the value of a form control? (2009-06-19)
- From: Garrett Smith
- Re: FAQ Topic - How do I get the value of a form control? (2009-06-19)
- From: Thomas 'PointedEars' Lahn
- FAQ Topic - How do I get the value of a form control? (2009-06-19)
- Prev by Date: Re: FAQ Topic - How do I get the value of a form control? (2009-06-19)
- Next by Date: Re: FAQ Topic - How do I get the value of a form control? (2009-06-19)
- Previous by thread: Re: FAQ Topic - How do I get the value of a form control? (2009-06-19)
- Next by thread: Re: FAQ Topic - How do I get the value of a form control? (2009-06-19)
- Index(es):
Relevant Pages
|
Loading