日期:2014-05-16 浏览次数:20342 次
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <div id="cc" style="color: Black; font-size: 34px;">klkjlkjlfs</div> </body> <script language="javascript" type="text/javascript"> var i=document.getElementById("cc").getAttributeNode("style").nodeValue; alert(i); </script> </html>
var i=document.getElementById("cc").getAttribute("style").cssText;
------解决方案--------------------
var i=document.getElementById("cc").style.cssText;
------解决方案--------------------