JavaScript HtML get values from one input -


i can't find info in internet. wrote in 1 text box 2 values separated space .for example

44 55. how transform these input ​​into 2 variables ?

assuming have input id myinput, then:

document.getelementbyid("myinput").onclick=function(){    var firstvar = this.value.split(" ")[0];    var secondvar = this.value.split(" ")[1]; } 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -