我有如下由 UI 框架生成的元素:
<div id="GENERATED_CONTAINER" style="position: fixed; z-index: 100; left: 368px; top: 52px; width: 545px; height: 846px;">
<div id="GENERATED_CONTENT style="opacity: 0.1; left: 5px; top: 5px; bottom: -5px; width: 545px; height: 846px;">
</div>
</div>
我需要编写一个脚本,从样式属性中删除 width
和 height
。
var elems = $("[id^='GENERATED_']");
//what should I apply now?
最佳答案
简单写.css
$("[id^='GENERATED_']").css({
width: 'inherit', //or the value
height: 'inherit' //or the value
})
关于javascript - 如何通过 JQuery 修改样式属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29466686/