Storing User Input inside a Variable

Hi, I'm trying to store user input inside a variable. The following is my code:

var input; var string; function setup(){ input = createInput(); string = input.value(); }

When I print string it is empty. Why isn't it storing the value for input? Is there a way to store input inside a variable?

Sign In or Register to comment.