<script type="text/javascript">
$(document).ready(function() {
$('a').click(function(){
$.get('data.php', {'page':$(this).attr("data")}, function(data){
$('#content').html(data);
});
});
});
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" type="text/javascript"></script>
<a href="#" data ="ajkdfk">apple</a>
<a href="#"data ="kasnfjk">pear</a>
<a href="#" data ="ankjlfs">banana</a>
<div id="content"></div>
I want to send value of data attribute of href tag
to ajax function like "data=ajkdfk"
and send to this value to data.
PHP page to update it to my database.