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 in Digital Marketing by Kichu
• 19,040 points
84 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 by narikkadan
• 37,660 points

Related Questions In Digital Marketing

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 in Digital Marketing by Kichu
• 19,040 points
167 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 in Digital Marketing by Kichu
• 19,040 points
48 views
0 votes
0 answers

When to use IMG vs. CSS background-image?

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

Mar 10 in Digital Marketing by Kichu
• 19,040 points
88 views
0 votes
0 answers

What is Keyword Density and how to create a script in PHP?

I am Working on a project to ...READ MORE

Mar 12 in Digital Marketing by Kichu
• 19,040 points
111 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 in Others by narikkadan
• 37,660 points
70 views
0 votes
1 answer

Is W3C validation important?

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

answered Feb 26 in Others by narikkadan
• 37,660 points
54 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
583 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
5,463 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 in Digital Marketing by narikkadan
• 37,660 points
400 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 in Digital Marketing by narikkadan
• 37,660 points
99 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