Edit This Code:
See Result »
<
!DOCTYPE
html
>
<
html
>
<
body
>
<
p
id
="demo"
>
<
/p
>
<
script
>
var
str =
"Hello"
;
var
arr = str.split(
""
);
var
text =
""
;
var
i;
for
(i =
0
; i < arr.length; i++) {
text += arr[i] +
"<br>"
}
document.getElementById(
"demo"
).innerHTML = text;
<
/script
>
<
/body
>
<
/html
>
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var str = "Hello"; var arr = str.split(""); var text = ""; var i; for (i = 0; i < arr.length; i++) { text += arr[i] + "<br>" } document.getElementById("demo").innerHTML = text; </script> </body> </html>
Result:
Privacy Policy