title: How to refer to an element with an id in dropmenu
body: <p>Please help me with this script. I'm trying to link some php code to a dropdown menu, but I get no reaction....</p>
  
  <p>The code is: </p>
  
  <p>js code:</p>
  
  <pre><code>function loadDoc1() {
        var xhttp = new XMLHttpRequest();
          xhttp.onreadystatechange = function() {
              if (this.readyState == 4 &amp;&amp; this.status == 200) {
                  document.getElementById("show2").innerHTML = this.responseText;
              }
          };
          xhttp.open("GET","user_manag.php",true);
          xhttp.send();
      }
  
      $(document).ready(function() {
          $("#a2").click(function() {
              $("#show2")".load("user_manag.php",function(responseTxt, statusTxt, xhr) {
                  if(statusTxt == "success")
                      alert("External content loaded successfully!");
                  if(statusTxt == "error")
                      alert("Error: " + xhr.status + ": " + xhr.statusText);
              });
          });
      });
  </code></pre>
  
  <p>HTML markup:</p>
  
  <pre><code>&lt;nav class="navbar navbar-inverse" style="border:4px solid white"&gt;
    &lt;div class="container-fluid"&gt;
      &lt;div class="navbar-header" style="margin-top:5px;"&gt;
        &lt;button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar"&gt;
          &lt;span class="icon-bar"&gt;&lt;/span&gt;
          &lt;span class="icon-bar"&gt;&lt;/span&gt;
          &lt;span class="icon-bar"&gt;&lt;/span&gt;
          &lt;span class="icon-bar"&gt;&lt;/span&gt;
        &lt;/button&gt; 
        &lt;a href="http://www.april-romania.ro"&gt;&lt;img src="logo1.jpg" style="width:40px;height:40px;"&gt;&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="collapse navbar-collapse" id="myNavbar"&gt;
        &lt;ul class="nav navbar-nav" &gt;
          &lt;li&gt;&lt;a href="#"&gt;&lt;span class="glyphicon glyphicon-search"&gt;&lt;/span&gt;Search&lt;/a&gt;&lt;/li&gt;
          &lt;li class="dropdown"&gt;
            &lt;a class="dropdown-toggle" data-toggle="dropdown" href="#"&gt;ADMIN
            &lt;span class="caret"&gt;&lt;/span&gt;&lt;/a&gt;
            &lt;ul class="dropdown-menu"&gt;
              &lt;li&gt;&lt;a id="a1" href="#" action="loadDoc1()"&gt;User management&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;button id="button1"&gt;User management&lt;/button&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a id="a2" href="#"&gt;Log report&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Change caseID&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Code tables&lt;/a&gt;&lt;/li&gt;  
            &lt;/ul&gt;
          &lt;/li&gt;  
  &lt;/div&gt;
  &lt;div class="container-fluid text-center"&gt;
    &lt;div class="row content"&gt;
      &lt;div class="col-sm-1 sidenav" style="border: 4px solid white";&gt;
  
      &lt;/div&gt;
  
      &lt;div id="show2" class="col-sm-8 text-left" style="background-color:rgb(200,200,200);border: 4px solid white; height: 100%"&gt;
              hereeeeeeeeee
  
      &lt;/div&gt;
      &lt;div class="col-sm-3 sidenav" style="background-color:gray;border: 4px solid white"&gt;
  
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>user_manag.php is:</p>
  
  <pre><code>&lt;?php
  
  echo "user management";
  
  ?&gt;
  </code></pre>
  
  <p>I'm trying to change content in <code>&lt;div&gt;#swow2</code> when I access one of the menu links.... I tried with ajax, with js, with jQuery, with attribute action, <code>onclick</code>, with links, buttons.... nothing seems to work. I think it doesn't recognize the ids I gave to the 'a' or 'button' elements in the menu.</p>