title: Accessing drop down menu using jquery
body: <p>My HTML code is:</p>
  
  <pre><code>&lt;div class="nav-collapse collapse"&gt;
  &lt;ul class="nav nav-pills ddmenu"&gt;
      &lt;li class="dropdown "&gt;&lt;a href="index.html"&gt;Home&lt;/a&gt;&lt;/li&gt;
      &lt;li class="dropdown"&gt;&lt;a href="about.html"&gt;About&lt;/a&gt;&lt;/li&gt;
      &lt;li class="dropdown active"&gt;
          &lt;a href="features.html"&gt;Features&lt;/a&gt;
          &lt;ul class="dropdown-menu"&gt;
              &lt;li&gt;&lt;a href="#" id="drp_pbx"&gt;Office&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#" id="drp_call"&gt;Center&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li class="dropdown"&gt;&lt;a href="apis.html"&gt;API&lt;/a&gt;&lt;/li&gt;
      &lt;li class="dropdown"&gt;&lt;a href="downloads.html"&gt;Download&lt;/a&gt;&lt;/li&gt;
      &lt;li class="dropdown"&gt;&lt;a href="blogs.php"&gt;Blog&lt;/a&gt;&lt;/li&gt;
      &lt;li class="dropdown"&gt;&lt;a href="contact.php"&gt;Contact&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p></p>
  
  <p>I got to drop downs menu under 'features.html' and I wrote JQuery to display <code>drp_pbx</code> and <code>drp_call</code> drop content depend on click event</p>
  
  <p>My JQuery is:</p>
  
  <pre><code>$(document).ready(function () {
      $("#callcenter_features").hide();
  
      $('#drp_pbx, #drp_call').click(function () {
          if (this.id == 'drp_pbx') {
              $("#pbx_features").show();
          }
          else if (this.id == 'drp_call') {
              $("#pbx_features").hide();
              $("#callcenter_features").show();
          }
      });
  });
  </code></pre>
  
  <p>If I am at features.html table every thing works as expected, if I tried from some other pages to access <code>drp_pbx</code> and <code>drp_call</code> functionalities not working properly, even if I clicked <code>drp_call</code> it always appear content of <code>drp_pbx</code>.</p>
  
  <p>I want to display content according to my click event of JQuery.</p>