<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<meta charset="utf-8" />
<style>
.li {
border: 1px solid black;
color:red;
font-style:italic;
}
</style>
<script src="Scripts/jquery-1.11.3.js"></script>
<script>
$(function () {
$("ul li").click(function () {
$(this).toggleClass("li");
})
})
</script>
</head>
<body>
<ul>
<li id="yaso">亚索</li>
<li id="xiaofa">小法</li>
<li id="gailun">盖伦</li>
<li id="timo">提莫</li>
</ul>
</body>
</html>
jQuery-匹配切换元素
猜你喜欢
转载自blog.csdn.net/cool__king/article/details/80806703
今日推荐
周排行