I have created a cu开发者_JS百科stom 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?
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')
If you are using jquery than for this will help you.
$("#tb1").attr("key")
for this textbox
<input type="text" id="tb1" key="mykey" text="" />
精彩评论