title: Drop-down get Selected item Text
body: <p>I want to change my button text when my dropdown item is clicked. I am using this code block but I can't do it:</p>
  
  <pre><code>&lt;div class="dropdown"&gt;
      &lt;button class="btn btn-danger dropdown-toggle" type="button" data-toggle="dropdown"&gt;Alan Ekle
      &lt;span class="caret"&gt;&lt;/span&gt;&lt;/button&gt;
      &lt;ul id="Secenekler" class="dropdown-menu"&gt;
        &lt;li&gt;&lt;a href="#"&gt;Isim&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;SoyIsim&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;Adress&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;Numara&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;Yaş&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;Tanıdık 1&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>And my script. I don't get the <code>alert()</code> message.</p>
  
  <pre><code>$(".dropdown-menu li a").click(function(){           
      alert("tiklandi");
  
      $(this).parents(".dropdown").find('.btn').html( $(this).text()  );
  
      console.log($(this).text());
      console.log($(this).text($(this).parents(".dropdown").find('.btn')));
  });
  </code></pre>