如何使用小书签删除内联 onclick 属性?
有一个烦人的网站,它通过使用
如何删除原来的 onclick
处理程序?
There is an annoying website out there that foils attempts to "open in new tab" by using <div onclick=>
instead of <a href=>
. I've written a bookmarklet, using jQuery, that creates a wrapper <a>
tag and inserts it within the <div>
around its content.
How can I remove the original onclick
handler?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
还没有提到:
Not mentioned yet:
未经测试,但是......
我想你已经尝试过
Untested, but...
I guess you have already tried to
在某些情况下,将
onclick
设置为null
不起作用,但这应该始终有效:In some circumstances setting
onclick
tonull
won't work, but this should always work: