1、each() 方法规定为每个匹配元素规定运行的函数。
$("button").click(function(){
$("li").each(function(){
alert($(this).text())// 输出所有的li元素
});
});
2、eq()
3、children() children 查找直接的子元素,不会跨层级
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
.t_ys{
background-color: #2F89F1;
height: 50px;
width: 600px;
display: flex;
justify-content: space-around;
align-items: center;
color: white;
margin-top: 10px;
}
</style>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script>
</head>
<body>
<div class="t_ys">
<div class="name">小一</div>
<div class="xh">12345678901</div>
<div class=