Discover getelementbyid properties, include the articles, news, trends, analysis and practical advice about getelementbyid properties on alibabacloud.com
Web standards can access any of the tags in the document through getElementById (), Getelementsbyname (), and getElementsByTagName ().(1) getElementById ():getElementById () can access a specific element in the document, as the name implies, by
Document. form name. object Name. attribute values may not be supported by third parties in this way. We recommend that you use the getelementbyid (), getelementsbyname (), and getelementsbytagname () methods () the result is an array.On the
getElementById (): The purpose of the method is to look for an element with a given id attribute worth:element = document.getElementById (ID);This method returns a node with the given ID attribute that is worth the element. If such an element does
GetelementbynameDoes not existOnlyGetelement _ S _ bynameAndGetelementbyid
ByidAccordingHtmlElementIDAttribute, according to specificationsIDIt should be unique and used to indicateElementFor example, ....... Therefore, the unique element handle
Sometimes we need to get a collection of objects and add attributes and time to this object.CodeCan also be implemented, but always write a bunch of findcontrol
Originally, the server control we used is an HTML Tag displayed on the client, so we
Dom Getting Started Tutorial: Properties and methods of DOM
Properties and methods define the DOM of the HTML of the programming interface.
Programming interfaceThe HTML of the DOM model as a set of node objects. Nodes can take advantage of
Of course, advanced browsers can be scripted for definition and data access. Very useful in project practice.
For example:The code is as follows: Using attribute methods to access the values of data-* custom propertiesIt is convenient to use the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.