Home How do I avoid applying a class to a span inside a Div?
Reply: 0

How do I avoid applying a class to a span inside a Div?

user770
1#
user770 Published in April 26, 2018, 1:41 pm

Is it possible or the best practice to avoid putting a class on a span which is nested inside a div?

I have the stereotypical 'to-do list' learning project and I need to line-through the item when clicked on but I also have a span element in there which will later be a delete button to remove the entire li.

<li><span class="deleteBtn">X</span> Birthday Cake</li>

At the moment the line-through is obviously targeting the span as well, so I'm wondering if there's a simple way to avoid it without a hack, otherwise I'm guessing I probably need to make the text a separate span and apply the line-through class to those span's

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.736615 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO