title: Working with <div> tag in JSP for making the contents hidden or visible
body: <p>I have written a javascript function.</p>
  
  <pre><code>function wellChecked(state) {
  if (state)
  {
  wellDropDown.style.visibility = 'visible';
  }
  else
  {
  wellDropDown.style.visibility = 'hidden';
  }
  }
  </code></pre>
  
  <p>I have a checkbox after the <code>Well Modification &lt;td&gt;</code> as given below,</p>
  
  <pre><code>&lt;tr&gt;
    &lt;td&gt;On Call&lt;/td&gt;
    &lt;td&gt;&lt;html:checkbox property="onCall"/&gt;&lt;/td&gt;
    &lt;td&gt;Well Modification&lt;/td&gt;
    &lt;td&gt;&lt;input type="checkbox" onclick="wellChecked(this.checked)" /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>When that checkbox is clicked I want the drop down list given under the <code>div id=wellDropDown</code> to be displayed. Defaultly, if the check box is not clicked, the drop down should not be displayed.</p>
  
  <pre><code>&lt;tr&gt;
    &lt;td&gt;Active&lt;/td&gt;
    &lt;td&gt;&lt;html:checkbox property="active"/&gt;&lt;/td&gt;
  &lt;div id="wellDropDown" style="visibility:hidden;"&gt;
    &lt;td&gt;     
      &lt;html:select property="wellFormatId"&gt;
      &lt;html:option value=""&gt;(Select)&lt;/html:option&gt;
      &lt;bean:define id="wellFormatColl"  name="wellFormats" scope="request"/&gt;
      &lt;logic:iterate id="wellFormats" name="wellFormatColl" indexId="index" type="com.astrazeneca.compis.data.WellFormatVO"&gt;
          &lt;% Long wellId = wellFormats.getWellFormatId();%&gt;
          &lt;% String wellIdNo = wellId.toString(); %&gt;
          &lt;html:option value="&lt;%=wellIdNo%&gt;"&gt;
          &lt;bean:write name="wellFormats" property="wellFormatName"/&gt;
          &lt;/html:option&gt;
      &lt;/logic:iterate&gt;
      &lt;/html:select&gt;
    &lt;/td&gt;
   &lt;/div&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>When I tried executing this code, I could see the drop down list getting displayed irrespective of the checkbox checked or not.</p>
  
  <p>Where I have went wrong in this scenario? Please give ur suggestions or ways to implement my requirement.</p>