Home how to identify which `span` has been clicked in order to change the css property of it?
Reply: 0

how to identify which `span` has been clicked in order to change the css property of it?

user824
1#
user824 Published in April 24, 2018, 8:32 am

I have a set of span tags (for color blocks) and inside each, I have another span tag (for icons). I want to change the css property of an icon from display:none to display:block as soon as one of the colors is clicked. The condition being that when one of the icons has display:block then the rest should be hidden.

JSFiddle to get a better idea of what I mean

So here is what i mean in steps:

  1. The colors' span/block should be clicked

  2. When one of them is clicked , the icon should be displayed

  3. When another one of the colors is clicked, icon should be displayed but the previous icon that was displayed should now be hidded

You need to login account before you can post.

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

© 2016 Powered by mzan.com design MATCHINFO