Fixed this issue: $("<div>foo\nbar</div>");