views:

31

answers:

3

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?

+3  A: 

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.

Aaron Digulla
cool thanks, thought this might be the case
Haroldo
+2  A: 

The obvious thing is that this is not properly formatted [X]HTML.
An <a> should not include a <button>

shoosh
+1  A: 

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>
mplungjan