try<div id="dv" style="color:red">hello world</div>
<input type="button" value="show style" onclick="alert(dv.style.color); alert(dv.currentStyle.fontFamily)">
<input type="button" value="show style" onclick="alert(dv.style.color); alert(dv.currentStyle.fontFamily)">
div{color:red}
</style>
<div id="dv" >hello world</div>
<input type="button" value="show style" onclick="alert(dv.style.color); alert(dv.currentStyle.fontFamily)">
这个就不行了