开发者

dynamically convert string to HTMLControl in javascript

I am having one id of textbox in form of string & I want to set some value from js. How could I set it

document.formid.getElementByTag("input").getelementId("strTextId").value = dynamicVal 

Other cases its HTMLInputObject ref. But here I am having string id only

Please guide me. I wanted to do it in javascript on开发者_C百科ly


If I understand your question correctly (questionable), you want to set the text property of a textbox. If that's correct, here's how you do it:

document.getElementById("strTextId").value = dynamicVal;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜