I have created a custom text box with property "key"(ASP.NET C#).I want to get the value of this property "key" using java script.How can I do this?
2 Answers
Not sure what you are asking.
if you have a textbox rendered like so:
<input type="text" id="foo" key="somekey" text="Hello" />
You could get the value of "key" in JS like so:
document.getElementById('foo').getAttribute('key')
2 Comments
Dee
I have created a server side custom control <cus:TextBox id="foo" Key="somekey" runat="server" Text="Hello"/> I want to get the value of key. In view source Html generated is <input type="text" id="foo" text="Hello" /> No Html is generated for custom property Key.
Raj Kaimal
If key is not generated in the html, then you have a problem with your custom control.