Click here to Skip to main content
15,922,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
function HoverEvent(ele, val) {

           document.getElementById("divEdit" + ele).style.display = "block";
           document.getElementById("<%=hfID.ClientID %>").value = ele;
           var button = document.getElementById("<%=Img1.ClientID %>");

           button.click();


}

.Aspx code
VB
<asp:ImageButton ID="Img1" runat="server" Text="a" Visible="false"
              style="width: 14px" onclick="Img1_Click" />



I want to get ID of this image button on mouse over of a div
but it return null .above given is my javascript code .
Posted

1 solution

Don't make Visible="false", it won't render on page. Just make it display:none like...
HTML
<asp:ImageButton ID="Img1" runat="server" Text="a" style="display:none; width: 14px" onclick="Img1_Click" />
 
Share this answer
 
Comments
Neha Mukesh 10-Jun-14 2:33am    
thanks a lot
Most welcome. :)

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