开发者

How to get Custom Property from ASP.NET Textbox using javascript?

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="" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜