I need to Break a String in the appropriate white space, so that the line break is inserted in the place of the space \n
escape character in>, in order that this jump line-by-line. Here's an example Logic below:
Casa Bonita
It looks like this:
Home
Pretty
For more details, see what I have achieved so far, but I want to do something more ...
<script>
window.onload=function(){
campo = "Casa Bonita"
letra = campo.split(" "); // Quebra Linha no Espaço
for(var i in letra)
alert(letra[i]);
}
</script>
Well, what is this something more ../ result being displayed in alert
line after row successively according to the size of the String.
However, I would like to skip each line using \n
and not <br>
within innerHTML();
. Get help!