title: need to concatenate content place holder id with div id for javascript code
body: <p>I am trying to implement show/hide div when certain value is selected from drop down list. But I have to concatenate the content place holder id with the div name. If I do not do so, the code block is not working.</p>
  
  <pre><code>&lt;asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"&gt;
      &lt;script type="text/javascript"&gt;
          function ShowHideDiv() {
  
          var ddlPassport = document.getElementById('&lt;%= ddlAnnualTax.ClientID %&gt;').value;
          var dvPassport = document.getElementById('&lt;%= dvPassport.ClientID %&gt;').value;
  
          ContentPlaceHolder1_dvPassport.style.display = ddlPassport == "2" ? "block" : "none";
      }
  &lt;/script&gt;
  
  
  &lt;div class="div_labels"&gt;
          &lt;asp:DropDownList ID="ddlAnnualTax" runat="server" Height="35px" Font-Size="Medium" Width="15%" Enabled="true" onchange="ShowHideDiv()"&gt;
              &lt;asp:ListItem Enabled="true" Text="select..." Value="-1"&gt;&lt;/asp:ListItem&gt;
              &lt;asp:ListItem Value="1"&gt;first year&lt;/asp:ListItem&gt;
              &lt;asp:ListItem Value="2"&gt;second year&lt;/asp:ListItem&gt;
          &lt;/asp:DropDownList&gt;   
      &lt;/div&gt;
      &lt;br /&gt;
      &lt;div class="div_labels"&gt;&lt;div id="dvPassport" style="display: none" runat="server"&gt; &lt;input type="text" id="txtPassport" /&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>In the code <code>ContentPlaceHolder1</code> is content place holder id and the div I need to show/hide is <code>dvPassport</code>. So I have to make <code>ContentPlaceHolder1_dvPassport</code> for the code to work. Why is it so ?</p>