Reputation: 1
I tried using:
$("#userInput").appendTo("gList") //The name of my variable is gList
but it didn't work.
Upvotes: 0
Views: 51
Reputation:
As i understand this gList
this is an array so you have to do next
var gList = [];
// ... do some job
var inputValue = $("#userInput").val(); //console.log(inputValue)
gList.push(inputValue); // console.log(gList)
If gList
is a string you can concatenate it gList = gList + inputValue
Thanks
Upvotes: 1