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
Post a Comment