I want to get the value of an href using java script and then pass it to another file of php, I did the code of JS and some friend add J query to it, in order to pass the value to the test.php file, but I don't why it is not working.
<script>
$(function(){
$('div#tabs ul li a').click(function() {
var n = $(this).attr('href');
var p=n.slice(5,6);
alert(p);
$.ajax({
type: 'post',
url: 'test.php'
data: {value : p}
success: function(data) {
//do something with response 'data'
}
});
});
</script>