First of all I'd go along with SA's solution of using
show()
and
hide()
to achieve your goal. The next problem is that you are using the wrong ID. ID's of ASP.net tags with
runat="server"
are what identifies the tag on the server side. When that tag gets rendered by ASP.net and output to the client (browser) the id attribute will be a different one. The good thing is you can find out what exactly the client id attribute is by using this code:
$(document).ready(function () {
$("#btn_Add").click(function () {
$("#<%=TextBox2.ClientID %>").css({ "background-color": "yellow", "font-size": "200%" });
$("#<%=TextBox1.ClientID %>").css('visibility', 'hidden');
});
});
Regards,
— Manfred