check each LI has a class "selected"

check each LI has a class "selected"

Hi,

I have a UL LI

  1. <ul class="selections">
  2.     <li class="check-option ok selected">
  3.         <div class="selections-text">Ok</div>
  4.         <div class="selections-icon"><img src="/img/icons/check-tick.png" class="check-icon"></div>
  5.     </li>
  6.     <li class="check-option">
  7.         <div class="selections-text">Advisory</div>
  8.         <div class="selections-icon"><img src="/img/icons/check-circle.png" class="check-icon"></div>
  9.     </li>
  10.     <li class="check-option">
  11.         <div class="selections-text">Defect</div>
  12.         <div class="selections-icon"><img src="/img/icons/check-cross.png" class="check-icon"></div>
  13.     </li>
  14. </ul>

I would like to check for each . check-option  to see if it hasClass(.selected) 

here is my code I have tried so far which I don't think is quite right:

$(".check-option").each(function() {

if($(this).hasClass("selected")) {
console.log("has been selected");
return false;
} else {
console.log("has NOT been selected");
return false;
}

});

Please help?