with .hasClass():
if ($('.target').hasClass('selected')) { // no dot in classname
// .target elem has the class .selected
}
with .is():
if ($('.target').is('.selected')) {
// .target elem has the class .selected
}
with .hasClass():
if ($('.target').hasClass('selected')) { // no dot in classname
// .target elem has the class .selected
}
with .is():
if ($('.target').is('.selected')) {
// .target elem has the class .selected
}