function SplitDemo(){ var s = "The,rain,in,Spain,falls,mainly,in,the,plain."; var sArr = s.split(","); for(i=0; i < sArr .length; i++){ alter(sArr [i]); }}