0
I have a set of div’s with Event click on jQuery. I’m not sure how to compare the clicked div’s if they have the same icon class. I have a div already selected, if the user click on another div in the same container I want to apply another Vent if she has similar icons comparing the classes of icons if they are equal.
Ex:
Selected Div1 has the <i class="fa fa-bicycle"></i>
Div2 when clicked should compare with div1 if it also has <i class="fa fa-bicycle"></i>
but I don’t know how to make this comparison in jQuery
I have several icons, I would have to create an array with their name and fill in each one to test the conditional?
– Wemerson Nino
To give you a more accurate answer, I would need to see the html. But the on click is already picking up all the icons you have on the page and comparing with the condition.
– LeAndrade
<ul class="deck">
 <li class="card">
 <i class="fa fa-diamond"></i>
 </li>
 <li class="card">
 <i class="fa fa-paper-plane-o"></i>
 </li>
 <li class="card">
 <i class="fa fa-anchor"></i>
 </li>
 </ul>
I have this example, there are repeated class pairs that when clicked would close or give Hide, but how to compare if the classes are repeated?– Wemerson Nino
Wemerson, you’re a little confused, you say li?
– LeAndrade