<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<script type="text/javascript" src="js/jquery-1.11.1.js"></script></head>
<script type="text/javascript">
$(function(){
$("div").mouseover(function(){
$(this).css("background","pink");
});
$("div").mouseout(function(){
$(this).css("background","");
});
$("div").click(function(){
var value=$(this).text();
alert(value);
});
});
</script>
<body>
<div>我是div</div>
</body>
</html>
悬浮背景变色
最新推荐文章于 2024-01-08 19:03:40 发布