why when i try to make the string(unordere d list) to be in a div it apears beside the div
Code:
function makeUnorderedList(txt){
var tempText="";
var splitResult = txt.split('\n');
var offer=document.getElementById("editor_displaying_text").innerHTML;
offer=offer.replace(txt,"");
for(i = 0; i < splitResult.length; i++){
tempText=splitResult[i];
tempText=tempText.replace(splitResult[i],'<li>'+splitResult[i]+'</li>');
offer+=tempText;
}
offer=offer.replace(tempText,'<ul>'+tempText+'</ul>');
document.getElementById("editor_displaying_text").innerHTML = offer;
}
Comment