V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
javashell
V2EX  ›  问与答

求助如何去水印

  •  
  •   javashell · 2022-11-22 23:07:44 +08:00 · 771 次点击
    这是一个创建于 730 天前的主题,其中的信息可能已经有所发展或是发生改变。

    公司内部网站上加了个水印功能,看了下大概只要把<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>&nbsp; <span>水印文字</span> &nbsp;</span>
    						<span>&nbsp; <span>2022-11-22</span> &nbsp;</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>&nbsp; <span>水印文字</span> &nbsp;</span>
    						<span>&nbsp; <span>2022-11-22</span> &nbsp;</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>&nbsp; <span>水印文字</span> &nbsp;</span>
    						<span>&nbsp; <span>2022-11-22</span> &nbsp;</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>&nbsp; <span>水印文字</span> &nbsp;</span>
    						<span>&nbsp; <span>2022-11-22</span> &nbsp;</span>
    					</p>
    					<p></p>
    				</div>
    			</div>
    
    1 条回复    2022-11-22 23:40:17 +08:00
    stein42
        1
    stein42  
       2022-11-22 23:40:17 +08:00   ❤️ 3
    document.querySelectorAll('[class^="ui-watermark"]').forEach(e => e.remove())
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5796 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 02:18 · PVG 10:18 · LAX 18:18 · JFK 21:18
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.