导读:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><h...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>javaScript语言示例--jQuery--事件</title>
<script type="text/javascript" src="http://www.bcty365.com/statics/js/bcty365_js/jquery.min.js"></script>
<script type="text/javascript">
//入口
$(function(){
//获取所有li节点,并添加点击事件
$("li").click(function(){
var s=$(this).html();
alert(s);
$(this).css("color","red");
});
});
</script>
</head>
<body>
<h2>javaScript语言示例--jQuery--事件</h2>
<ul>
<li>John</li>
<li>Karl</li>
<li>Brandon</li>
</ul>
<ul>
<li>Glen</li>
<li>Tane</li>
<li>Ralph</li>
</ul>
</body>
</html>