View Single Post
Old 01-20-2013, 07:44 PM   PM User | #1
DDH
New to the CF scene

 
Join Date: Jan 2013
Posts: 9
Thanks: 10
Thanked 0 Times in 0 Posts
DDH is an unknown quantity at this point
Javascript stack

Hi,

I am having troubles creating java script stack. Basically I need to store user input from text box into stack and display how the stack grows in text box at the time of storing the values, if that makes sense. Can anyone give me a hand. This is what I got so far, but instead of stacking elements one over another it adds em one below another:

Code:
function userInput(e){
 
 var x = document.getElementById("TextBox1");
 
 if(e.which == 13)
 
 if (document.getElementById("input").value > "") {
 
 backStack.push(document.getElementById("input").value);
 
 x.innerHTML = backStack.join('<br/>'); 
 
 document.getElementById("input").value = "";
 
    }
 }
DDH is offline   Reply With Quote