tags:

views:

30

answers:

1

$("div#myDiv").css("content") returns undefined in IE8. Works perfect in other browsers and IE6 & 7.

+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
Agreed. 'content' is a legitimate CSS property; even if browsers are returning the text of the element, I wouldn't depend on that.
Tom