1, Prototype library
This is the first library that simplifies document.getElementById() to $.
For example: the original var myele=document.getElementById('id') is equivalent to var myele=$('id')
In addition, $ also extends some functions
For example: var eleArray=$('id1','id2','id3','id4') can return an array containing 4 objects.
In addition to $, this function library also provides the method getElementsByClassName to find elements according to class names; the method addClassName to add class names; the method removeClassName to remove class names, etc., which greatly facilitates our use.
2, jQuery
It is more powerful than prototype.
For example:
document.getElementById()==>$('#money')
document.getElementsByTagName==>$('p')
Returns a set of elements with the same class name: $('.money')
and can be derived like css: $("#content table.dateTable")
Provided in the jQuery library The css rule parsing capabilities are amazing, and it supports css1, css2, css3, and most selectors in XPath.
3, DoJo program library
Get the element object based on the id: var money=Dojo.byId('money')
Get it based on the class name Element:Dojo.html.getElementByClass()
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn