How do I create a textbox and button in HTML so that when I click it, it will fire a javascript method with the value and output the result below the textbox/button? And if you click again, it will continue to add new lines of output below the textbox/button?
Say I have the following function:
function double(number)
{
return number * 2;
}
and I want a textbox and button so if I click the button three times, I will get this:
Textbox Here (value of 2) - Button here
4
4
4
How is this done? Do I use a form with two input tags? Or use button tag? How do I make it keep outputing below the textbox/button?
I'm sorry if this question is difficult to read, my english isn't very good.