title: Post href value to ajax function
body: <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>&lt;script type="text/javascript"&gt;
    $(document).ready(function() {
      $('a').click(function(){
        $.get('data.php', {'page':$(this).attr("data")}, function(data){
          $('#content').html(data);
        });                         
      });
   });
  &lt;/script&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;a href="#" data ="ajkdfk"&gt;apple&lt;/a&gt;
  &lt;a href="#"data ="kasnfjk"&gt;pear&lt;/a&gt;
  &lt;a href="#" data ="ankjlfs"&gt;banana&lt;/a&gt;
  &lt;div id="content"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I want to send value of data attribute of <code>href tag</code> to ajax function like <code>"data=ajkdfk"</code> and send to this value to data. </p>
  
  <p>PHP page to update it to my database.</p>