An example of a JavaScript operation element locating element. It is a javascript instance.
It is a good choice to use js to operate element locating elements. The following is an example. If you need it, you can check it out.
<! DOCTYPE html>
Positioning element in javascript
Supplement: lz, please add Baidu hi or qq25846111. Let's discuss it in detail.
Does "[html] [body] [table] [tbody]" mean
<Html>
<Body>
<Table>
<Tbody> what is the form?
In this case, you can search at the first level.
// Obtain the list of all body elements (only one will be available here)
MyDocumentElements = document. getElementsByTagName ("body ");
// The body element we need is the first element in the list.
MyBody = myDocumentElements. item (0 );
// Now, let's get all the table elements in the child element of the body
MyPElements = myBody. getElementsByTagName ("table ");
// Here, if you need to find the specified table, you can use a circular statement to find it from the item.
MyTable = myPElements. item (0 );
// Repeat the above process to obtain the tbody
MyTbody = myTable .. getElementsByTagName ("tbody"). item (0 );
Of course there are other methods. lz can take a look at this link.
2.16.mozilla.org/..86html
If you have any questions about dom programming, please send a message.
In JavaScript, how does one find the child element nodes of an element?
Function get_nextSibling (n)
{
Y = n. nextSibling;
While (y. nodeType! = 1)
{
Y = y. nextSibling;
}
Return y;
}