有些页面样式不规范,没有写在一个class里,例如:<div ></div>

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

 

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

有些页面样式不规范,没有写在一个class里,例如:<div ></div>

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

 

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

相关文章:

  • 2021-12-27
  • 2021-12-30
  • 1970-01-01
  • 2021-12-30
  • 2021-11-30
  • 2021-11-30
  • 2022-12-23
  • 2021-08-26
猜你喜欢
  • 2021-12-30
  • 2021-09-23
  • 2021-05-29
  • 2022-12-23
  • 2021-05-28
  • 2021-12-29
  • 2021-12-30
相关资源
相似解决方案