公司内部网站上加了个水印功能,看了下大概只要把<div>
标签删除就可以去水印了? 但是 div 标签的 id "ui-watermark-"和"-wrap"之间是随机生成的字符串。因为不会前端,这里请问大家怎么可以动态的删除呢?(最好给个 js 代码,谢谢大家)
<div id="ui-watermark-c7hdnb-wrap">
<div id="ui-watermark-c7hdnb" style="display: block; pointer-events: none; position: absolute; width: 100%; height: 100%; overflow: hidden; z-index: 9999; top: 0px; left: 0px; text-align: center;">
<div class="ui-watermark-c7hdnb-mark-line" style="overflow: hidden;">
<div class="ui-watermark-c7hdnb-mark" style="width: 200px; height: 200px; pointer-events: none; z-index: -1; float: left; overflow: visible; opacity: 0.06; transform: rotate(-15deg); position: relative; margin-right: 0px;">
<div style="width:100%;position:absolute;top:50%;transform:translateY(-50%);">
<p style="pointer-events:none;font-size:14px;color:#000;"></p>
<p>
<span> <span>水印文字</span> </span>
<span> <span>2022-11-22</span> </span>
</p>
<p></p>
</div>
</div>
<div class="ui-watermark-c7hdnb-mark" style="width: 200px; height: 200px; pointer-events: none; z-index: -1; float: left; overflow: visible; opacity: 0.06; transform: rotate(-15deg); position: relative; margin-right: 0px;">
<div style="width:100%;position:absolute;top:50%;transform:translateY(-50%);">
<p style="pointer-events:none;font-size:14px;color:#000;"></p>
<p>
<span> <span>水印文字</span> </span>
<span> <span>2022-11-22</span> </span>
</p>
<p></p>
</div>
</div>
<div class="ui-watermark-c7hdnb-mark" style="width: 200px; height: 200px; pointer-events: none; z-index: -1; float: left; overflow: visible; opacity: 0.06; transform: rotate(-15deg); position: relative; margin-right: 0px;">
<div style="width:100%;position:absolute;top:50%;transform:translateY(-50%);">
<p style="pointer-events:none;font-size:14px;color:#000;"></p>
<p>
<span> <span>水印文字</span> </span>
<span> <span>2022-11-22</span> </span>
</p>
<p></p>
</div>
</div>
<div class="ui-watermark-c7hdnb-mark" style="width: 200px; height: 200px; pointer-events: none; z-index: -1; float: left; overflow: visible; opacity: 0.06; transform: rotate(-15deg); position: relative; margin-right: 0px;">
<div style="width:100%;position:absolute;top:50%;transform:translateY(-50%);">
<p style="pointer-events:none;font-size:14px;color:#000;"></p>
<p>
<span> <span>水印文字</span> </span>
<span> <span>2022-11-22</span> </span>
</p>
<p></p>
</div>
</div>
1
stein42 2022-11-22 23:40:17 +08:00 3
document.querySelectorAll('[class^="ui-watermark"]').forEach(e => e.remove())
|