wigglesby Posted November 25, 2009 Share Posted November 25, 2009 Hi I have a div (<div id="box info>") which has a unordered list of data retrieved from the db. If there is no data, then the div will display with an empty <ul></ul> and no <li< tags. I want some jQuery that will hide the <div id="box info"> if there are no <li> tags within it. Is this possible? Link to comment https://forums.phpfreaks.com/topic/182913-hide-a-div-based-on-divs-contents/ Share on other sites More sharing options...
JustLikeIcarus Posted November 25, 2009 Share Posted November 25, 2009 First I would remove the space from your id attribute. Make it box_info or something. Then for the jQuery... $('#box_info:not(:has(li))').hide(); Link to comment https://forums.phpfreaks.com/topic/182913-hide-a-div-based-on-divs-contents/#findComment-965450 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.