I want to call function on imagebutton click.
this is the code that doesn't work. What's wrong?
- <table>
- <tr>
- <td>
- <asp:TextBox ID="txtSearch" runat ="server" Visible ="false" ClientIDMode="Static" />
- <asp:ImageButton ID="imgSearch" runat="server"
- OnClientClick ="return txtSearchAnim();"
- ImageUrl="../Resources/Images/search2.png" />
- </td>
- </tr>
- </table>
- <script type="text/javascript">
- function txtSearchAnim() {
- var x = document.getElementById("txtSearch");
- if (x.style.display === "none") {
- x.style.display = "block";
- } else {
- x.style.display = "none";
- }
- $('#txtSearch').addClass('animated bounceOutLeft');
- }
- </script>