I make div as editable. while i tried to parse div\'s text, i was needed to do the below regular expression.
innerDOM = \"
//FINAL ANSWER var domString = "", temp = ""; $("#div-editable div").each(function() { temp = $(this).html(); domString += "" + ((temp == "") ? "" : temp); }); alert(domString);
see this fiddle for answer.