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

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

qt - Change color of QGraphicsView rubber band -

c++ - Visible files in the "Projects" View of the Qt Creator IDE if using the CMake build system -