If div contains something

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

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.