Hrvoje Voda

Hrvoje Voda

  • NA
  • 30
  • 1.2k

Click event function call

Jun 29 2018 6:37 AM
I want to call function on imagebutton click.
 
this is the code that doesn't work. What's wrong?
  1. <table>  
  2. <tr>  
  3. <td>  
  4. <asp:TextBox ID="txtSearch" runat ="server" Visible ="false" ClientIDMode="Static" />  
  5. <asp:ImageButton ID="imgSearch" runat="server"  
  6. OnClientClick ="return txtSearchAnim();"  
  7. ImageUrl="../Resources/Images/search2.png" />  
  8. </td>  
  9. </tr>  
  10. </table>  
  11. <script type="text/javascript">  
  12. function txtSearchAnim() {  
  13. var x = document.getElementById("txtSearch");  
  14. if (x.style.display === "none") {  
  15. x.style.display = "block";  
  16. else {  
  17. x.style.display = "none";  
  18. }  
  19. $('#txtSearch').addClass('animated bounceOutLeft');  
  20. }  
  21. </script>  

Answers (1)