asp.net中asp:button如何写鼠标经过变色
展开全部
将如下代码拷贝到<head>中:
<script language="javascript">
function onMouseOver(Button)
{
button.sytle.backgroundColor='red';
}
function onMouseOut(button)
{
button.sytle.backgroundColor='';
}
</script>
将如下代码拷贝到<body>中:
<input type="button" id="btnTest1" runat="server" onmouseover="onMouseOver(this)" onmouseout="onMouseOut(this)" value="click me" />
<asp:Button ID="btnTest2" runat="server" Text="click me" onmouseover="onMouseOver(this)" onmouseout="onMouseOut(this)" />
<script language="javascript">
function onMouseOver(Button)
{
button.sytle.backgroundColor='red';
}
function onMouseOut(button)
{
button.sytle.backgroundColor='';
}
</script>
将如下代码拷贝到<body>中:
<input type="button" id="btnTest1" runat="server" onmouseover="onMouseOver(this)" onmouseout="onMouseOut(this)" value="click me" />
<asp:Button ID="btnTest2" runat="server" Text="click me" onmouseover="onMouseOver(this)" onmouseout="onMouseOut(this)" />
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询