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
)
精彩评论