Cookies improve the way our website works, by using this website you are agreeing to our use of cookies. For more information see our privacy policy.
OK
Returns an element or a collection of elements from the current collection by name or index.
Parameters:
nameOrIndex
Required. A string or a zero-based integer that specifies the element or elements to retrieve.
If an integer value is specified, it specifies the index of the element to retrieve.
If this parameter is a string, then it specifies a value for the name or id property of the element or elements to retrieve.
Return value:
If no match is found, it returns undefined.
If exactly one match is found, it returns the matching element.
If more than one match is found, it returns a boundElements sub-collection filled with the matching elements.
The sub-collection contains the matching elements in source order.
Returns an element or a collection of elements from the current collection by name or index.
Parameters:
nameOrIndex
Required. A string or a zero-based integer that specifies the element or elements to retrieve.
If an integer value is specified, it specifies the index of the element to retrieve.
If this parameter is a string, then it specifies a value for the name or id property of the element or elements to retrieve.
subIndex
Optional.
If more than one matching element is found for the index parameter (possible only if it is a string), the item method creates a boundElements sub-collection filled with the matching elements.
In that case, the subIndex property specifies the position of the element in the sub-collection to retrieve.
In other cases, the subIndex property has no meaning.
Return value:
If no match is found, it returns null.
If exactly one match is found, it returns the matching element.
If more than one match is found, it returns a boundElements sub-collection filled with the matching elements.
The sub-collection contains the matching elements in source order.
Returns an element or a collection of elements from the current collection by name.
Parameters:
name
Required. String that specifies a value for the name or id property of the element or elements to retrieve.
Return value:
If no match is found, it returns null.
If exactly one match is found, it returns the matching element.
If more than one match is found, it returns a boundElements sub-collection filled with the matching elements.
The sub-collection contains the matching elements in source order.
Returns a NodeList collection that contains all elements to which the specified behavior is attached.
Example HTML code 1:
This example illustrates the use of the boundElements collection:
Code
news.xml
<head><scripttype="text/javascript">function OnDataFieldChange () {
alert ("The '" + event.dataFld + "' field of a movie record has changed within the data source object.");
for (var i = 0; i < event.boundElements.length; i++) {
var element = event.boundElements[i];
element.runtimeStyle.border = "2px solid red";
}
alert ("The data source is bound to the elements with red border.");
}
</script></head><body><xmlid="movies"oncellchange="OnDataFieldChange ();"><?xmlversion="1.0"?><movies><movie><name>Clark Kent</name><jobtitle>Superman</jobtitle><born>1966</born></movie><movie><name>Lois Lane</name><jobtitle>Reporter</jobtitle><born>1964</born></movie></movies></xml>
Modify the contents of an input field and click outside the field.
<br/><br/><table><tbody><tr><td>Name: <inputdatafld="name"type="text"datasrc="#movies"/></td><td>Jobtitle: <inputdatafld="jobtitle"type="text"datasrc="#movies"/></td></tr></tbody></table><br/><br/><tablewidth="100%"cellpadding="0px"cellspacing="2px"border="1px"datasrc="#movies"datapagesize="2"><thead><tr><th>Name</th><th>Jobtitle</th><th>Born</th></tr></thead><tbody><tr><td><inputdatafld="name"/></td><td><inputdatafld="jobtitle"/></td><td><inputdatafld="born"/></td></tr></tbody></table></body>
<?xmlversion="1.0"encoding="utf-8"?><news><channel><item><title>Paula Abdul leaves American Idol</title><description>Paula Abdul has officially confirmed that she won’t be returning to American Idol this season. "With sadness in my heart, I’ve decided not to return to Idol," she wrote on her Twitter page.</description><pubDate>Wed, August 5, 2009 19:52:31 +0200</pubDate><link>http://www.tribute.ca/news/index.php/its-official-paula-abdul-leaves-american-idol/2009/08/05/</link></item><item><title>Criminal Minds star Moore hit by car</title><description>Shemar Moore, 39, who plays FBI Agent Derek Morgan in the CBS drama Criminal Minds, was hit by a car while bicycling in Los Angeles last Saturday.</description><pubDate>Thu, August 4, 2009 13:28:12 +0200</pubDate><link>http://www.tribute.ca/news/index.php/criminal-minds-star-moore-hit-by-car/2009/08/04/</link></item><item><title>Madonna writes love song for ex-husband</title><description>Madonna has sparked speculation that she wants to get back with her ex-husband, Guy Ritchie, after writing a love song for him in which she calls him her "eternal love".</description><pubDate>Fri, July 31, 2009 04:01:50 +0200</pubDate><link>http://www.tribute.ca/news/index.php/madonna-writes-love-song-for-ex-husband/2009/07/31/</link></item></channel></news>