Can I nest button inside another button?

It is not valid to put a <button> inside a <button> element.
In the W3C recomendation for the button element you can read:

Content model:
Phrasing content, but there must be no interactive content descendant.

[source: w3.org (emphasis mine)]

Interactive content includes:

  • a
  • audio (if the controls attribute is present)
  • button
  • embed
  • iframe
  • img (if the usemap attribute is present)
  • input (if the type attribute is not in the hidden state)
  • keygen
  • label
  • object (if the usemap attribute is present)
  • select
  • textarea
  • video (if the controls attribute is present)

Leave a Comment