1

Why this html code not work in firefox ? when i clicked the button link not work but google chrome work fine.

<button>
<a style="text-decoration:none" href="index.php?cmd=BlogAddForm">Add Note</a>
</button>
Elshan
  • 7,339
  • 4
  • 71
  • 106
  • 3
    This is not valid HTML. Some browsers allow it, others don't. – Barmar Dec 19 '13 at 03:41
  • possible duplicate of [Button inside of anchor link works in Firefox but not in Internet Explorer?](http://stackoverflow.com/questions/802839/button-inside-of-anchor-link-works-in-firefox-but-not-in-internet-explorer) – Barmar Dec 19 '13 at 03:43
  • 1
    Oops, just realized that duplicate question is the opposite nesting. But they're both invalid. – Barmar Dec 19 '13 at 03:44
  • It works for me on FF 25.0.1 – Supun Silva Dec 19 '13 at 03:47

2 Answers2

1

This is technically not valid html syntax. Some browsers allow it, but you would need to remove the anchor tag from within the button.

tier1
  • 6,303
  • 6
  • 44
  • 75
1

Because it's not valid: http://www.w3.org/TR/2011/WD-html5-20110525/the-button-element.html - an <a> element is an "interactive element", which is not allowed: http://www.w3.org/TR/2011/WD-html5-20110525/content-models.html#interactive-content.

Tieson T.
  • 20,774
  • 6
  • 77
  • 92