我添加了3个Button按钮,属性设置如下:
<asp:Button ID="Btn_1" runat="server" Text="第一个" />
<asp:Button ID="Btn_2" runat="server" Text="第二个" onmouseover="document.Form1.Btn_1.style.display='none';"/>
<asp:Button ID="Btn_3" runat="server" Text="第三个" onmouseover="document.Form1.Btn_2.style.display='none';"
onmouseout="document.Form1.Btn_2.style.display='';" />提示有3个警告,说属性“onmouseover”和“onmouseout”不是元素“Button”的有效属性,但是运行页面后上述的效果依然存在,这是为什么
<asp:Button ID="Btn_1" runat="server" Text="第一个" />
<asp:Button ID="Btn_2" runat="server" Text="第二个" onmouseover="document.Form1.Btn_1.style.display='none';"/>
<asp:Button ID="Btn_3" runat="server" Text="第三个" onmouseover="document.Form1.Btn_2.style.display='none';"
onmouseout="document.Form1.Btn_2.style.display='';" />提示有3个警告,说属性“onmouseover”和“onmouseout”不是元素“Button”的有效属性,但是运行页面后上述的效果依然存在,这是为什么
<asp:Button ID="Btn_1" runat="server" Text="第一个" />
<asp:Button ID="Btn_2" runat="server" Text="第二个" onmouseover="document.getElementById('Btn_1').style.display='none';" />
<asp:Button ID="Btn_3" runat="server" Text="第三个" onmouseover="document.getElementById('Btn_2').style.display='none';" onmouseout="document.getElementById('Btn_2').style.display='block';" />
问一下,Btn_1.Attributes.add( )方法是添在哪个函数下的
Btn_1.Attributes.add("onmouse","document.Form1.Btn_1.style.display='none';")