Results 1 to 3 of 3

Thread: Show/Hide based on content within div

  1. #1
    Join Date
    Jan 2010

    Show/Hide based on content within div

    I would like to show or hide a header element (e.g. <h3></h3>) based up a div tag that either contains content or not. The content is dynamically added or shown, but the header element isn't, which results in having the header element shown with no content below it many times. Here's an example:

    <div id=related-section>
    <h3>Related Articles</h3>
    <div id=related>
    <p>This content is being shown, sometimes it is not shown.</p>

  2. #2
    Join Date
    Apr 2010
    how is the div related being populated? the answer would depend on what methods you are using to populate data in the div.

  3. #3
    Join Date
    Jan 2010
    The <p></p> area is being populated by Coldfusion. There are two states for what <div id=related> looks like, it's either 1) <div id=related><p>bla bla bla bla</p></div> or 2) <div id=related></div>.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center