Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jQuery check if class contains any element

jQuery(function ($) {
	if ($(".className").length == 0) {
		$(".element").removeAttr("style").hide();
	}else{
		$(".element").removeAttr("style").show();
	}	
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jQuery #check #class #element
ADD COMMENT
Topic
Name
3+2 =