I want to select all the elements that have the two classes a and b.
a
b
So, only the e
your code $(".a, .b") will work for below multiple elements (at a same time)
$(".a, .b")
if you want to select element having a and b both class like than use js without coma
$('.a.b')