Is it bad practice to use spans as buttons W3Schools is doing that

0 votes
span tag, that acts as a close button for the modal. Isn't this semantically incorrect? Or is there some legitimisation to do that?

It is kind of weird that the "web standardisation consortium" is putting out examples like that. But maybe I am missing something here.
Feb 28, 2022 in Digital Marketing by Kichu
• 19,040 points
670 views

1 answer to this question.

0 votes

yes to be precise it a bad way to use spans as buttons user should reach the button via keyboard 

<span tabindex="0">Button</span>

Also a good practice is to adding ARIA - attributes:

<span tabindex="0" role="button" aria-pressed="false">Button</span>
answered Mar 1, 2022 by narikkadan
• 63,600 points

Related Questions In Digital Marketing

0 votes
0 answers
0 votes
0 answers

Can I remove the JSON-LD schema that Yoast adds to my WordPress site?

would like to remove the JSON-LD schema ...READ MORE

Mar 3, 2022 in Digital Marketing by Kichu
• 19,040 points
1,002 views
0 votes
0 answers

How to make website more SEO friendly when the content is coming from the database? [closed]

How can i make my database content ...READ MORE

Mar 5, 2022 in Digital Marketing by Kichu
• 19,040 points
353 views
0 votes
0 answers

When to use IMG vs. CSS background-image?

In what situations is it more appropriate ...READ MORE

Mar 10, 2022 in Digital Marketing by Kichu
• 19,040 points
638 views
0 votes
1 answer

Is it bad practice to use spans as "buttons"? W3Schools is doing that

it wont become a bad practice if ...READ MORE

answered Feb 26, 2022 in Others by narikkadan
• 63,600 points
1,005 views
0 votes
1 answer

Is W3C validation important?

try using use W3C conventions as much ...READ MORE

answered Feb 26, 2022 in Others by narikkadan
• 63,600 points
459 views
0 votes
1 answer

How blockchain hides it's HTML source?

When you click View Source, you see ...READ MORE

answered Jul 17, 2018 in Blockchain by Shashank
• 10,400 points
1,227 views
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
10,594 views
0 votes
1 answer

H2 comes before h1 in source, Is it ok?

Semantically, H1 should come before H2 in ...READ MORE

answered Mar 12, 2022 in Digital Marketing by narikkadan
• 63,600 points
2,590 views
0 votes
1 answer

How to check if a website has been Banned by Google

first of all banned pages wont have ...READ MORE

answered Mar 1, 2022 in Digital Marketing by narikkadan
• 63,600 points
1,005 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP