Hi there,
I would like javascript to be able to hide a div based upon a containing div having no content.
The text/content of the div is being pulled in by the CMS, if the user has not inputted anything into the CMS how can the container div “CaseStudyRow” be hidden.
Each div I want to hide (if the cms system says its blank) have ID’s assigned to them ; id=”1″, id=”2″, id=”3″ and so on….
I have the following code: where the div i would like to hide IF the contents are empty according to the CMS is CaseSudyRow.
Would an If statement be the one needed here ?
Something like:
[COLOR=”Red”]IF[COLOR=”SeaGreen”][I]id1[COLOR=”Red”]THEN
I do not know javascript that well, if not at all ?
Code:
[CODE]<div id=”1″ class=”CaseStudyRowFirst”>
<div class=”CaseStudySectionName”> Client: </div>
<div class=”CaseStudyContent” id=”Client”></div><!– CMS stuff –>
</div>
<div id=”2″ class=”CaseStudyRow”>
<div class=”CaseStudySectionName”> Sector: </div>
<div class=”CaseStudyContent” id=”Sector”></div><!– CMS stuff –>
</div>
<div id=”3″ class=”CaseStudyRow”>
<div class=”CaseStudySectionName”> Shows / Location: </div>
<div class=”CaseStudyContent” id=”Show”></div><!– CMS stuff –>
</div>
<div id=”3″ class=”CaseStudyRow”>
<div class=”CaseStudySectionName”> Challenge / Objective: </div>
<div class=”CaseStudyContent” id=”Challenge”></div><!– CMS stuff –>
</div>
<div id=”4″ class=”CaseStudyRow”>
<div class=”CaseStudySectionName”> Testimonial: </div>
<div class=”CaseStudyContent” id=”Testimonial”></div><!– CMS stuff –>
</div>
<div id=”5″ class=”CaseStudyRowLast”>
<div class=”CaseStudySectionName”> Additional Text: </div>
<div class=”CaseStudyContent” id=”AddedText”></div><!– CMS stuff –>
</div>
</div>
Thank you for your help ?