【发布时间】:2012-01-04 02:20:45
【问题描述】:
我正在尝试使用 coffeescript/jQuery 执行以下操作:
1) 检索显示在 html 中的所有“主题”(见下文)
2) 隐藏除列出的前 5 个主题之外的所有主题。
我尝试执行以下操作,但没有工作
//Retrieve the entire list of and hide all but the first 5 topics in the list
$(".topics .topic")[5..-1].hide()
谁能告诉我如何正确地从 HTML 文档中检索主题列表并随后隐藏除前 5 个主题之外的所有主题?
【问题讨论】:
标签: jquery html dom hide coffeescript