Is there a better way to select multiple elements having the same parent elements?

Is it possible to simplify this selector by seeing that the parent elements are the same?

 $(".card .card-title .fa-star-o, .card .card-title .fa-star")

for example, something like:

 $(".card .card-title (.fa-star-o, .fa-star)")

(above does not work, obviously)

Of course, the comma path works, but I just want to find out if there is a better, cleaner way.

+4
source share
1 answer

Here

$(".card .card-title").find(".fa-star-o, .fa-star")
                      .css({"color": "red", "border": "2px solid red"});
+2
source

Source: https://habr.com/ru/post/1653071/


All Articles