Click here to Skip to main content
15,911,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
On mouseover 'button91' I would like change its color and show a label. Hereunder is my code but unable to complete it. Can someone guide.


XML
<asp:Button ID="Button91"  Class="stylebutton" runat="server"  Font-Size="Small" ForeColor="teal"
                                onclick="Button91_Click"
                                style="z-index: 1; left:790px; top: 1px; position: absolute;width:140px;cursor:pointer; font-family:Sans-Serif;   text-align:left; height:17px;  font-weight:400; "
                                Text="Progressive dealers  " />
                            <img  onmouseover="document.getElementByID("Button91").value='Hello'> <img />


Thanks
Posted

using jQuery you can easily done this
JavaScript
$(document).ready(function()
{
$('#Button91').mouseover(function()
{
$(this).attr('style','background-color:red');
 $(this).after('<label id='lblNewlabel'>labeltext</label>');
});
});


Hope this helps
 
Share this answer
 
Change button code to below

HTML
<img id="img1" onmouseover="changeButtonLable();" />



Then add a javascript function as below:

XML
<script type="text/javascript">
       function changeButtonLable() {
           var btn = document.getElementById('<%=Button91.ClientID%>');
           if (btn)
               btn.value = 'Hello';
        }

   </script>



Hope this help.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900