<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!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 runat="server">
<title>无标题页</title>
<style type="text/css">
*
{
font-size:25px;
}
td{ width:15px; height:15px;}
</style>
<script type="text/javascript">
function myclick(obj)
{
if(obj.id=="unselect")
{
obj.innerText="★";
obj.id="selected";
}
else
{
obj.innerText="☆";
obj.id="unselect";
}
}
function moseOver(obj)
{
if(obj.innerText=="☆")
{
obj.innerText="★";
}
}
function moseOut(obj)
{
if(obj.innerText=="★" && obj.id=="unselect")
{
obj.innerText="☆";
}
}
</script>
</head>
<body>
<div>
<table>
<tr>
<td id="unselect" style="cursor:pointer;" οnclick="myclick(this)" οnmοuseοver="moseOver(this)" οnmοuseοut="moseOut(this)">☆</td>
<td id="unselect" style="cursor:pointer;" οnclick="myclick(this)" οnmοuseοver="moseOver(this)" οnmοuseοut="moseOut(this)">☆</td>
<td id="unselect" style="cursor:pointer;" οnclick="myclick(this)" οnmοuseοver="moseOver(this)" οnmοuseοut="moseOut(this)">☆</td>
<td id="unselect" style="cursor:pointer;" οnclick="myclick(this)" οnmοuseοver="moseOver(this)" οnmοuseοut="moseOut(this)">☆</td>
<td id="unselect" style="cursor:pointer;" οnclick="myclick(this)" οnmοuseοver="moseOver(this)" οnmοuseοut="moseOut(this)">☆</td>
</tr>
</table>
</div>
</body>
</html>
onmouseout和onclick
最新推荐文章于 2020-04-26 18:59:01 发布