Trigger javascript in href attribute with jQuery .click() (or similar)
问题 Unfortunately, I'm working with some 3rd party javascript, which inserts links into my pages. Rather than just use these links as is, I want to use proxy elements, which, when clicked, trigger the click event on the 3rd party links. The 3rd party links pack javascript into the href attribute, like this: <a id="horribleLink" href="javascript:doSomething()">Click me</a> My proxy element looks like this: <button rel="horribleLink" class="linkProxy">No, click me</button> And a bit of jQuery'd