I\'m trying to remove a specific div if a separate div is empty. Here\'s what I\'m using:
$(document).ready(function () { if (\'#leftmenu:empty\') {
You can extend jQuery functionality like this :
Extend :
(function($){ jQuery.fn.checkEmpty = function() { return !$.trim(this.html()).length; }; }(jQuery));
Use :
if($("#selector").checkEmpty()){ console.log("Empty"); }else{ console.log("Not Empty"); }