<div class="codetitle"> <span><a style="CURSOR: pointer" data="24825" class="copybut" id="copybut24825" onclick="doCopy('code24825')"><u>复代码码</u></a></span> 代码如下:</div> <div class="codebody" id="code24825"> <br><%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestClassSelector.aspx.cs" Inherits="WebApplication1.TestClassSelector" %> <br><!DOCTYPE html> <br><html xmlns="http://www.w3.org/1999/xhtml"> <br><head runat="server"> <br><제목></제목> <br><script src="Scripts/jquery-1.9.0.min.js"></script> <br><style type="text/css"> <br>.first_div { <br>배경색:빨간색; <br>} <br>.second_div { <br>배경색:녹색; <br>} <br>.first_span { <br>너비:500px; <br>높이:100px; <br>} <br>.eric_sun_class { <br>font-family:Arial; <br>글꼴 크기:18px; <br>} <br></style> <br></head> <br><본문> <br><form id="form1" runat="server"> <br><div> <br><div class="first_div"> <br>첫번째 div입니다 <br></div> <br><div class="second_div"> <br>두 번째 div입니다 <br></div> <br><div class="first_div"> <br><span class="first_span"> <br>첫 번째 스팬입니다<br></span> <br></div> <br><span class="first_span eric_sun_class"> <br>첫 번째 스판에릭선 수업입니다. <br></span> <br><br /> <br><span class="eric_sun_class"> <br>에릭썬 수업입니다. <br></span> <br><br /> <br><input type="button" value="Test" onclick="btn_Click();" /> <br></div> <br></form> <br></body> <br></html> <br><script type="text/javascript"> <br>function btn_Click() { <br>alert($(".first_div").text()); <br>alert($(".first_div.first_span").text()); <br>} <br></script> <br> </div> <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="16539" class="copybut" id="copybut16539" onclick="doCopy('code16539')"><u>复代码</u></a></span> 代码如下:</div> <div class="codebody" id="code16539"> <br>$(".first_div, .first_span") <br> </div> <br>将包含有.first_div 或者 .first_span" 的对象city取到。 这里取到 4 个 对象。 <br>此处的Html对应 <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="94513" class="copybut" id="copybut94513" onclick="doCopy('code94513')"><u>复代码</u></a></span> 代码如下:</div> <div class="codebody" id="code94513"> <br><div class="first_div"> 🎜></div> <br><div class="first_div"> <br><span class="first_span"> <br>첫 번째 스팬입니다. <br></span> 🎜></div> <br><span class="first_span eric_sun_class"> <br>첫 번째 스팬 에릭선 수업입니다 <br><br> <br> <br><br> </div> <br>复aze代码<div class="codetitle"><span><a style="CURSOR: pointer" data="34034" class="copybut" id="copybut34034" onclick="doCopy('code34034')"> 代码如下:<u></u> </a>$(".first_div .first_span") </span></div> <div class="codebody" id="code34034">将以 .first_div 为类的控件 下的 以 .first_span 为类 的对象取到(类与类之间带有 空格 逐层取)。 这里只取到 1个。 <br>对应의 className= "first_span" 此处的Html对应 <br> </div> <br><br><br>复代码<div class="codetitle"> <span><a style="CURSOR: pointer" data="15471" class="copybut" id="copybut15471" onclick="doCopy('code15471')"> 代码如下:<u></u> </a><div class ="first_div"> </span><span class="first_span"> </div>첫 번째 범위입니다. <div class="codebody" id="code15471"></span> <br></div> 🎜><br><br><br><br>复主代码<br> </div> <br> 代码如下:<div class="codetitle"> <span> <a style="CURSOR: pointer" data="97717" class="copybut" id="copybut97717" onclick="doCopy('code97717')">$(".first_span.eric_sun_class") <u></u> </a>将包含有.first_span 并且同时包含有 .eric_sun_class 类的 对象取到(类与类之间没有공格 类似于 '与' 操)。 这里只取到1个。 </span>对应의 className ="first_span eric_sun_class" 此处的Html 对应 </div> <div class="codebody" id="code97717"> <br><br> </div>复代码<br><br><br> 代码如下:<div class="codetitle"><span> <a style="CURSOR: pointer" data="24421" class="copybut" id="copybut24421" onclick="doCopy('code24421')">< 스팬 클래스="first_span eric_sun_class"> <u>첫 번째 스판에릭선 수업입니다. </u></span> </a></span></div>