How can I access server controls like a textbox from an external .js file using J-query?

I need to change the height of a textbox using a J query. I need to write this code in an external .js file. How to access the height of a textbox in a J request in an external .js file?

0


a source to share


2 answers


You can access it in the same way in inline code:



$('#<%=mycontrol.ClientID%>')

      

+1


a source


It doesn't matter if your js is in an external file, you should write it the same way as inline or external.

If the textbox has an id, you can use:



$ ("# Textbox1") height () ;.

http://docs.jquery.com/CSS/height

+1


a source







All Articles