title: How to get button value by ajax
body: <p>I'm having issue by getting button value by ajax. 
  I've got 4 buttons with other values </p>
  
  <pre><code>&lt;button type="button" value="today" onclick=postdata class="btn btn-primary btn-lg "&gt;Today&lt;/button&gt;
  &lt;button type="button" onclick=postdata value="week"  class="btn btn-primary btn-lg "&gt;Week&lt;/button&gt;
  &lt;button type="button" value="month" onclick=postdata class="btn btn-primary btn-lg "&gt;Today&lt;/button&gt;
  &lt;button type="button" onclick=postdata value="year"  class="btn btn-primary btn-lg "&gt;Week&lt;/button&gt;
  
  
  
  function postdata(link) {
      $.ajax({
          url: link,
          type: "POST",
          data: {
              date:$('button').val()
          }
      })
  }
  </code></pre>
  
  <p>Onclick I always get value of first button , can somebody tell me how to get value of clicked button by ajax ?</p>