Advertisement $(document).ready(function() { img = $(\'#ad-after img\'); if(!img.length) { $(\'#ad-after p\').hide(); } }); ...