string split method (each in line) javascript
<p>I'm trying to write a code for a program that allow the user to enter a word or sentnce in text-box then press the button.</p>

<p>When the user press the button the result should appear  </p>

<p>actually I faced a problem in last part which is split the sentence and put each in separate line.</p>

<p>What I know is that I can put them in separate line by write a code such that:</p>

<pre><code>var myString = "zero one two three four";

var mySplitResult = myString.split(" ");

for(i = 0; i &lt; mySplitResult.length; i++){
    document.write("&lt;br /&gt; Element " + i + " = " + mySplitResult[i]); 
}
</code></pre>

<p>but when I did it, it didn't work
 <p> my code </p></p>

<pre><code> function t {
    var r=input.split(".");
             for (var i = 0; i &lt; r.length; i++){
        r.innerHTML ="&lt;br/&gt; "  + r[i];}
          } 
</code></pre>
