现在的位置: 首页 > 综合 > 正文

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

2013年11月23日 ⁄ 综合 ⁄ 共 1065字 ⁄ 字号 评论关闭

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类。

抱歉!评论已关闭.