js split, at the end of a line
<p>Im making a web page that, will get the html code of it self and then, replace all the harmful html codes like <code>&lt;</code> and <code>&gt;</code> and change them to the ascii counterparts so it doesn't skew it up but it looks write to the user also. </p>

<p>I need it to sperate the lines, by ether using the break line html code <code>&lt;br /&gt;</code> or some other way, I know how many lines I have by using <code>themehtml.split("\n");</code> </p>

<p>So the question is 'I need a way to add a line break at the end of the line'</p>

<p>This Is my most of my js code that kind of helps the question a bit </p>

<pre><code>$(".edit_html_button").click(function()
                {
                    var themehtml = $(".wrapper").html();
                    var oldhtml = _grubber_blog.html();

                    themehtml = themehtml.replace(/&lt;/g, "&amp;#60;"); //slowly removing html codes
                    themehtml = themehtml.replace(/&gt;/g, "&amp;#62;"); //slowly removing html codes
                    themehtml = themehtml.split(' ').join('&amp;#32;');//slowly removing html codes

                    themehtml = ("&lt;div class='numberboxleft'&gt;&lt;/div&gt;&lt;div class='edit_theme' contenteditable='true'&gt;"+themehtml+"&lt;/div&gt;");

                    themehtml = themehtml.split("\n");  

                    //alert(themehtml);

                    _grubber_blog.css("background-color", "#fff");
                    $("#tiptip_holder").remove();   
                    $("._grubber_blog_customize").html(" ");    
                    $("._grubber_blog_customize").html(themehtml);

                    //adds the numbers up the left side

                    var e = 0;
                    var lenght = themehtml.length;
                    var numbers = "";

                    while (e &lt; lenght){
                        numbers = $(".numberboxleft").html();
                        $(".numberboxleft").html(numbers + e + "&lt;br /&gt;");
                        e++;
                    }

                });
</code></pre>
