代码如下:
<%@ page language="c#" autoeventwireup="true" codebehind="testclassselector.x.cs" inherits="webapplication1.testclassselector" %>
<!doctype html>
<html xmlns="https://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="scripts/jquery-1.9.0.min.js"></script>
<style type="text/css">
.first_p {
background-color:red;
}
.second_p {
background-color:green;
}
.first_span {
width:500px;
height:100px;
}
.eric_sun_class {
font-family:arial;
font-size:18px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<p>
<p class="first_p">
this is the first p
</p>
<p class="second_p">
this is the second p
</p>
<p class="first_p">
<span class="first_span">
this is the first span
</span>
</p>
<span class="first_span eric_sun_class">
this is the first span + eric sun class.
</span>
<br />
<span class="eric_sun_class">
this is the eric sun class.
</span>
<br />
<input type="button" value="test" onclick="btn_click();" />
</p>
</form>
</body>
</html>
<script type="text/javascript">
function btn_click() {
alert($(".first_p").text());
alert($(".first_p.first_span").text());
}
</script>
. 代码如下:
$(".first_p, .first_span")
. 代码如下:
<p class="first_p">
this is the first p
</p>
<p class="first_p">
<span class="first_span">
this is the first span
</span>
</p>
<span class="first_span eric_sun_class">
this is the first span + eric sun class.
</span>
. 代码如下:
$(".first_p .first_span")
. 代码如下:
<p class="first_p">
<span class="first_span">
this is the first span
</span>
</p>
. 代码如下:
$(".first_span.eric_sun_class")
. 代码如下:
<span class="first_span eric_sun_class">
this is the first span + eric sun class.
</span>
如对本文有疑问, 点击进行留言回复!!
在使用@angular/cli创建的angular项目上添加postcss等一系列移动端自适应插件
Android 入门第六讲05-JSON解析第三方框架Gson(GSON框架使用方法,GSON解析Json数据(json对象,对象嵌套,数组,对象数组,json对象嵌套JSON对象数组))
网友评论