官术网_书友最值得收藏!

Chapter 3. DOM Traversal Methods

In addition to the selector expressions described in Chapter 2, Selector Expressions, jQuery has a variety of DOM traversal methods that help us select elements in a document. These methods offer a great deal of flexibility, even allowing us to act upon multiple sets of elements in a single chain as follows:

$('div.section').addClass('lit').eq(1).addClass('profound');

At times, the choice between a selector expression and a corresponding DOM traversal method is simply a matter of taste. However, there is no doubt that the combined set of expressions and methods makes for an extremely powerful toolset for acting on any part of the document we desire.

主站蜘蛛池模板: 汕尾市| 镇巴县| 兴仁县| 屏山县| 肥西县| 澜沧| 奉节县| 舞钢市| 卢湾区| 永登县| 古田县| 酒泉市| 黑河市| 烟台市| 渭源县| 云和县| 康保县| 阳山县| 精河县| 静乐县| 凤阳县| 新蔡县| 乐山市| 千阳县| 大同县| 基隆市| 新绛县| 呼伦贝尔市| 广河县| 连山| 西城区| 高安市| 蚌埠市| 金平| 仁布县| 湘乡市| 咸丰县| 东阳市| 凤山市| 平武县| 兖州市|