$("div#myDiv").css("content") returns undefined in IE8.
Works perfect in other browsers and IE6 & 7.
views:
30answers:
1
+3
A:
Are you sure you shouldn't be doing:
$('div#myDiv').html()
or
$('div#myDiv').text()
That's how I would go about getting the "content" of a DIV.
Note, that if you are going after the content inserted by CSS, note that in IE8 you need to have a DOCTYPE (reference) for the document.
Note: Internet Explorer 8 (and higher) supports the content property if a !DOCTYPE is specified.
tvanfosson
2010-03-25 21:52:10
Agreed. 'content' is a legitimate CSS property; even if browsers are returning the text of the element, I wouldn't depend on that.
Tom
2010-03-25 21:53:13