开发者

How to display a value in a variable in textbox?

I am new to script. I need to display the value in textbox i have created the textbox inside the tag of my html file. The processed value is in "var a" variable开发者_JAVA百科. How can i set the value in textbox


With JavaScript something like

var a = 'bla bla bla';
var textBox = document.getElementById("TextBoxID");
textBox.value = a;

Maybe you want to wrap it in some function (pass the text instead)

function addText(text) {
    code above;
}

Dont forget to bind it with some kind of event (example onClick)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜