ITeye博客

jquery常见用法

icarusliu · 2009-04-01 16:10 · jquery · jQuery · Markdown

  • $(a,b)

a:用来查找的字符串

b:用来查找的范围(上下文)

例:$("input:radio", document.forms[0]) 在文档的第一个表单中,查找所有的单选按钮(即: type 值为 radio 的 input 元素)。

  • $(attribute,value)

例:$("input[name='newsletter']").attr("checked", true);

      $("input[name!='newsletter']").attr("checked", true);

  • $(a).hide(),$(a).show()

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。