Possible Duplicate:
jQuery - remove style added with .css() function




我想从div中删除样式属性,我不能使用removeAttribute和removeProperty,因为removeAttribute会删除整个样式,而remove Property在ie中不起作用。
还有其他方法可以做到这一点。

<div style="visiblity:hidden;margin-right:10px;margin-left:10px">


我只想删除可见性样式属性。

最佳答案

像这样使用.css

$(elementSelect).css('marginRight', null);


要么

$(elementSelect).css('marginRight', '0px').css('visibility', 'visible');

09-21 00:05