It says it's OK to have a `a` in `button`
See original GitHub issueHi,
The request for “Can I include a
in button
” has a wrong result as it says it’s OK but it’s not because the content model is:
Phrasing content, but there must be no interactive content descendant and no descendant with the tabindex attribute specified.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Can I nest a <button> element inside an <a> using HTML5?
No, it isn't valid HTML5 according to the HTML5 Spec Document from W3C: Content model: Transparent, but there must be no interactive content...
Read more >Is it OK to have a link that looks like a button? - Accessible Web
Answer. Yes, it is OK to use links that look like buttons, but it is highly encouraged to use the native elements if...
Read more >Is It Possible to Nest an HTML <button> Element Inside an <a ...
In this snippet, learn whether it's possible to nest a tag within an in HTML5. To have a button linking to somewhere, you...
Read more >Why the 'Ok' Button is No Longer Okay - UX Movement
'Ok' is not a specific action. It's an exclamation. When users click the 'Ok' button, they're not saying “okay”, they're doing a specific ......
Read more >What can I use inside a button tag in place of <a>? - SitePoint
it works fine but I get an error saying the <a> tag cannot be nested ... If you have a single button on...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you for taking this important point into account.
I’m not sure there are other cases like this but if I find one, I will tell you.
About the mechanism to ask precision about the attributes on the tag, it could be a second question like “does the parent tag have this attribute? [dropdown list of the interesting attributes]”. According to the answer, it could change the content in the page.
I’m sorry, but with the current implementation and making the result of tag matching, this approach is not possible. Perhaps, in the next versions it will be possible.