(3)选择元素——(17)练习(Exercises)

To complete these exercises, you will need the index.htmlfile for this chapter, as well as the finished JavaScript code as found in complete.js. These files can be downloaded from the Packt Publishing web site at http://www.packtpub.com/support.

为了完成这些练习,你需要这一章的一个index.html文件,何忧在complete.js中的一根已经完成的js代码。这些文件可以从Packt Publishing 网站:http://ww.packtpub.com/support上下载下来。

Challenge exercises may require use of the official jQuery documentation at http://api.jquery.com/.
1.  Add a class of specialto all of the <li>elements at the second level of the nested list.
2.  Add a class of yearto all of the table cells in the third column of a table.
3.  Add the class specialto the first table row that has the word Tragedyin it.
4.  Challenge: Select all of the list items (<li>s) containing a link (<a>). Add the class afterlinkto the sibling list items that follow the ones selected.

5.  Challenge: Add the class tragedyto the closest ancestor <ul>of any .pdflink.

这些富有挑战的练习可能需要使用 http://api.jquery.com的官方jquery文档。
1、为所有嵌套列表的第二层级的li元素添加一个special类。
2、为所有在表格中的第三列的方格加上一个year类。
3、为表格的含有Tragedy单词的第一行家还是那个一个special类
4、挑战:选择所有的含有链接(a)的列表项(li)。为选择的这些元素的后面的兄弟列表节点添加一个afterlink类。
5、挑战:为所有.pdf链接的最近的祖先ul元素添加一个tragedy类。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值