'Is it okay to add a headline inside an HTML button?

I was wondering if it is semantically correct or OK to add a headline such as h1, h2, h3, h4 inside an HTML button.

Example

<button type="button">
   <h3>Button headline text</h3>
</button>


Solution 1:[1]

Semantically? Maybe. You could make arguments either way and it would depend on context.

However, syntactically, it is invalid. HTML does not allow h3 elements to be descendants of button elements.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Quentin