想让p标签里面的url自动变成隐藏需要代码div class=link img src=httpsreswxqqcomtwx_fedfinderhelperfinder-helper-webresfaviconico div h3视频创作者h3 phttpschannelsweixinqqcomp div button打开button div
可以使用JavaScript代码将
标签里面的url变成隐藏,代码如下:
const links = document.querySelectorAll('.link p');
links.forEach(link => {
const url = link.textContent;
link.innerHTML = `<a href="${url}" target="_blank">链接已隐藏</a>`;
});
将上述代码放在页面加载完成后执行即可。代码会将
标签里面的url转换成一个链接,链接的文本为“链接已隐藏”。用户点击该链接时会跳转到原本的url。
原文地址: https://www.cveoy.top/t/topic/bDCJ 著作权归作者所有。请勿转载和采集!