1. jQuery¶ÔÏóÓëDOM¶ÔÏóµÄÇø±ð¼°Ï໥ת»¯:
DOM¶ÔÏóתjQuery: $(domObj);
jQuery¶ÔÏóתDOM¶ÔÏó: jQueryObj.get(0);
jQuery¶ÔÏóÊÇ·ñΪ¿ÕµÄÅжÏ:
if (jQueryObj.get(0) != null) {
//´ËjQueryObj²»Îª¿Õ.
}
DOM¶ÔÏóÊÇ·ñΪ¿ÕµÄÅжÏ:
if (domObj != null) {
//´ËdomObj²»Îª¿Õ.
}
2. jQueryÑ¡ÔñÆ÷£º
»ù±¾Ñ¡ÔñÆ÷: "#id", ".class", "tagName", "*", "selector1, selector2.."
²ã´ÎÑ¡ÔñÆ÷:
¹ýÂËÑ¡ÔñÆ÷:
3. jQueryµÄDOM²Ù×÷:
ÄÚ²¿²Ù×÷: append(), prepend(), appendTo(), prependTo();
Íⲿ²Ù×÷: after(), before()
ɾ³ý£¬Ìæ»»½Úµã²Ù×÷
¸´Öƽڵã²Ù×÷
4. jQueryʼþ£º
$(document) = $();
$(document).ready(function() {}) = $(function() {});
bind(), unbind(),
trigger(): ´¥·¢Ê¼þ£¬ä¯ÀÀÆ÷ÏìÓ¦²Ù×÷
tringgerHandler(): ´¥·¢Ê¼þ£¬²»×ö²Ù×÷
hover(mouseOver, mouseOut)
toggle(fn1,fn2,fn3)
5.jQueryÖÐget,set·½·¨:
html()==innerHTML
text() == innerText
val() == value, (selectµÄ»°´ÓÏÂÍùÉÏÖ»Òªtext»òvalueÆ¥Åä¼´Ñ¡ÖÐ)
width()
height()
css(),
»¹Óжà¼ÓÒ»¸ö²ÎÊýµÄattr().
¡¡