I'm trying to split the innerText of a div on the newlines in the source for it. This works fine with:
$('div').text().split("\r\n|\r|\n")
But this fails in IE 7, due to the newlines apparently being stripped out. jQuery 1.3.2 doesn't appear to be at fault since i also tried both:
$('div')[0].innerText.split("\r\n|\r|\n")
and
$('div')[0].innerHTML.split("\r\n|\r|\n")
Neither do any of the above work if i change the div to a pre.
It appears that the newlines are once the source is parsed into the DOM. :( Is this so? Is there no way to get at them with javascript?