title: Get value of dropdown bootstrap onclick Jquery function
body: <p>I have a table in my HTML file and in one of the columns I have a button component from bootstrap, when the button is clicked a drop down appears with three options - 'medium', 'low', 'servicerequest'. When this item is clicked, I am trying to get the value of the item clicked.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(".table table-hover table-condensed").on('click', '.dropdown-menu', function(e) {
    var id = $(this).attr('#mediumpriority');
    alert(id);
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>@import url('//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css');
  body {
    margin: 10px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/&gt;
  &lt;script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;table class="table table-hover table-condensed"&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;Priority&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;
          &lt;div class="btn-group"&gt;
            &lt;button type="button" class="btn btn-danger btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"&gt;
  High
  &lt;/button&gt;
            &lt;div class="dropdown-menu"&gt;
              &lt;a id="mediumpriority" class="dropdown-item"&gt;Medium&lt;/a&gt;
              &lt;a class="dropdown-item"&gt;Low&lt;/a&gt;
              &lt;a class="dropdown-item"&gt;Service Request&lt;/a&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>When I click on 'High' button, I get a drop down of three options, if i click on 'Medium' I expect an alert to show the the 'Medium' value:</p>
  
  <pre><code>&lt;a id="mediumpriority" class="dropdown-item"&gt;Medium&lt;/a&gt;
  </code></pre>
  
  <p>Can someone point out why I am not getting this alert when I run and click on the priority 'medium' ?</p>