jQuery: check if a div contains a div with class on
if ($(".toDiv").find(".on").length > 0){
///do something
}
or
if ($(".toDiv .on").length > 0){
///do something
}
$('div.toDiv').each(function() {
if($('div.on', this).length > 0) {
//do something with this
}
});