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
• 16,050 points
25 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
• 7,860 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
• 16,050 points
18 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
• 16,050 points
22 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
• 16,050 points
20 views
0 votes
0 answers

H2 comes before h1 in source, Is it ok?

IF i use <h2> for left sidebar ...READ MORE

Mar 11 in Digital Marketing by Kichu
• 16,050 points
42 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
• 7,860 points
19 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
• 7,860 points
19 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
460 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
4,266 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
• 7,860 points
39 views
0 votes
1 answer

How to over-ride meta data in Wordpress, using Squirrly SEO

if (is_archive()){ add_filter('sq_title', 'filter_product_wpseo_metadesc'); function filter_product_wpseo_metadesc($wpseo_metadesc){ ...READ MORE

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