Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have one value in javascript

JavaScript
var = 11:20;


how to take value in two diffrent varaibles, i want value like

JavaScript
a= 11;
b=20;


how can i get these value
Posted
Updated 13-Jul-15 22:22pm
v2

You can use Javascript split method to break a string. Check this link![^]
 
Share this answer
 
split and access result by index, for example
JavaScript
var str = "3333,222";
var res = str.split(",");
var a =res[0];
var b =res[1];
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900