html emails - problem with <button> inside <a> tags?
The following looks fine but when i test it in gmail, it opens the link twice (in 2 new tabs), it's as if there's some kind of wierd event bubbling happening....
<a href="some_url"> <button>Approve</button> </a>
am i missing something obvious?
A link can't contain a button. Either use a button or style the link like a button (i.e. that it looks like a button).
That said: The event bubbling is probably happening because the button does it's job and then, the link processes the mouse click event, too.
The obvious thing is that this is not properly formatted [X]HTML. An <a> should not include a <button>
There are browsers that will not even allow the link to be clicked. Style the href instead
<a href="" style="text-decoration:none; border-top: 2px #cce3ff solid; border-left: 2px #cce3ff solid; border-bottom: 2px #31557f solid;border-right: 2px #31557f solid;">GO</a>