ericyi

有些页面样式不规范,没有写在一个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()方法

分类:

技术点:

相关文章:

  • 2021-11-30
  • 2021-11-30
  • 2022-02-10
  • 2022-01-22
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-23
  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
  • 1970-01-01
  • 2022-12-23
  • 2021-11-30
相关资源
相似解决方案