Fire Hand
Fire Hand

Reputation: 26376

Get LinkButton text using javascript

How can i get the text of LinkButton in .NET using javascript?

Tried .innerHTMl, .innerText, .value...all not working....

Upvotes: 6

Views: 10932

Answers (2)

sam
sam

Reputation: 685

for server side control use ClientID.

document.getElementById('<%= lnk1.ClientID %>').innerText

works for asp.net server side controls.

Upvotes: 2

Ghyath Serhal
Ghyath Serhal

Reputation: 7632

document.getElementById('lnk1').innerText 

this should solve your problem, i tried it now and it works.
can you show me your code.

Upvotes: 5

Related Questions