添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

有些页面样式不规范,没有写在一个class里,例如:<div id="show" style="width:100px; padding-top:10px; font-size:12px;"></div>

这种情况下清空style可以removeAttr()方法移除style属性来实现

$("#show").removeAttr("style"); //ie,ff均支持
$("#show").attr("style","");   //ff支持,ie不支持 

附:http://www.w3school.com.cn/jquery/attributes_removeattr.asp  Jquery removeAttr()方法