首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

详解jQuery是怎么工作的

2012-08-21 
详解jQuery是如何工作的jQuery如何工作首先,你需要下载jQuery的一个副本,并在你的HTML页面(最好在插入HEA

详解jQuery是如何工作的
jQuery如何工作首先,你需要下载jQuery的一个副本,并在你的HTML页面(最好在插入<HEAD>标签)。然后,你需要写函数来告诉jQuery的做什么。下面的图表说明了jQuery如何工作的细节:

详解jQuery是怎么工作的

如何获得元素?编写jQuery函数是比较容易的(感谢精彩的??文档)。关键的一点,你必须要学会的是如何得到确切的元素,你要申请的影响。

    $("#header") = get the element with id="header"    $("h3") = get all <h3> element    $("div#content .photo") = get all element with class="photo" nested in the <div       id="content">    $("ul li") = get all <li> element nested in all <ul>    $("ul li:first") = get only the first <li> element of the <ul>

热点排行