$("div#myDiv").css("content")
在 IE8 中返回未定义。
在其他浏览器以及 IE6 和 7 中完美运行。
最佳答案
您确定不应该这样做吗:
$('div#myDiv').html()
或
$('div#myDiv').text()
这就是我获取 DIV 的“内容”的方法。
请注意,如果您要查找由 CSS 插入的内容,请注意在 IE8 中您需要为文档提供 DOCTYPE ( reference )。
Note: Internet Explorer 8 (and higher) supports the content property if a !DOCTYPE is specified.
关于jquery - $ ("div#myDiv").css ("content") 在 IE8 中返回未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2519640/