hasClass(): $("button").click(function(){ alert($("p:first").hasClass("intro")); }); 检查第一个 <p> 元素是否包含 "intro" 类