var str = "535"; for(x = 0;x < str.length; x++) { str1 = str.charAt(x); document.write( str1 ); }