From the site http://javascript.info/tutorial/searching-elements-dom we get this summary
There are 5 main ways of querying DOM:
getElementById
getElementsByTagName
getElementsByName
getElementsByClassName
(except IE<9)querySelector
(except IE<8 and IE8 in compat mode)
All of them can search inside any other element. All of them excepts the last one return live collections.
XPath is kind-of supported in most browsers, but very rarely used.
Ingen kommentarer:
Send en kommentar