asp.net - Values of ASP labels in JavaScript -


I have ASP.NET label control which I use to pass text / string value from my C # backend I am

  function changeTab () click on the {var tab.   

= Document.getElementById ('& lt;% = searchType.Text%>'). Text content; If (tab == "official") {$ ('# tab-container') Easytabs ('Select', '# Tab 1-Officer'); Alert ("it was removed: 4"); } And {$ ('# tab-container'). Easytabs ('Select', '# Tab1-Company'); Alert ("it was removed: 5"); }

As far as I know, var tab is missing the value from my label What am I doing wrong?

I think what you want is this:

  Var tab = document.getElementById ('& lt;% = searchType.ClientID% & gt;'). Internal HTML;   

Use ClientID to get a label ID, which is then used as a parameter for getElementById is. Once you have a label, you will find the text of the label on the internal HTML property.


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -