Im trying to define variable values from values inputted into an input textfield onkeyup. I’ve never done this before and cant find it on Google so was wondering if anybody had any idea on how to do this…
<input type="text" id="values" />
var numberone = "";
var numbertwo = "";
var numberthree = "";
Imagine the user types into the input box “thomas the tankengine” thomas would become ‘var numberone’. ‘the’ would become number two and so on…
Is this possible?
You can split a string by spaces using the split() function
eg