<INPUT id="button1" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; WIDTH: 26px; BORDER-BOTTOM: medium none; HEIGHT: 17px; BACKGROUND-COLOR: #d4ecf5;CURSOR: hand"onclick="top.location='admin_login.aspx'" type="button" value="退出" name="button1">中,怎么样可以做到当鼠标移动到文字的地方时,让文字变色,移开又变回原来的颜色?
你可以添加个imagebutton控件如下<asp:ImageButton id="ImageButton1" runat="server" Height="36px" Width="130px" ImageUrl="images/plmm.gif"></asp:ImageButton>然后在page_load事件里写注册JS代码ImageButton1.Attributes.Add("onmousemove", "javascript:document.all.ImageButton1.src='images/plmm1.jpg';")
ImageButton1.Attributes.Add("onmouseout", "javascript:document.all.ImageButton1.src='images/plmm.gif';")这样就可以了!
<head>
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
<script language="javascript" for="btnExit" event="onmouseover">
btnExit.style.color = "red";
</script>
<script language="javascript" for="btnExit" event="onmouseout">
btnExit.style.color = "blue";
</script>
</head>
<body>
<form>
<INPUT id="btnExit" type="button" value="退出" name="button1" style="COLOR: blue">
</form>
</body>
</html>