JQuery简单学习(3)——JQuery选择器
选择器允许您对元素组或单个元素进行操作。
————————————————————jQuery 选择器在前面的章节中,我们展示了一些有关如何选取 HTML 元素的实例。<html><head><script type="text/javascript" src="/jquery/jquery.js"></script><script type="text/javascript">$(document).ready(function(){ $("button").click(function(){ $("p").css("background-color","yellow"); });});</script></head><body><h2>This is a heading</h2><p>This is a paragraph.</p><p>This is another paragraph.</p><button type="button">Click me</button></body></html>?————————————————————更多的实例语法 描述?$(this) 当前 HTML 元素?$("p") 所有 <p> 元素?$("p.intro") 所有 的 <p> 元素?$(".intro") 所有 的元素?$("#intro") id="intro" 的第一个元素?$("ul li:first") 每个 <ul> 的第一个 <li> 元素?$("[href$='.jpg']") 所有带有以 ".jpg" 结尾的 href 属性的属性?$("div#intro .head") id="intro" 的 <div> 元素中的所有 的元素?