$("button").click(function(){ $("div").empty(); });
function isEmpty( el ){ return !$.trim(el.html()) } if (isEmpty($('#element'))) { // do something }