How do I separate a comma delimited variable into multiple variables?
This is probably very elementary, but I'm still learning. I've imported a record from an XML file and have the result : "a,b,c,d,e,f,g,h"
if you .split() the list, you'll end up with a single array with 'n' number of elements. Not -exactly- 8 separate variables, but 8 elements that can be accessed individually.
var myList = "a,b,c,d,e,f,g,h"; var myArray = myList.split( ',' ); alert( myArray[ 4 ] );