I have a jQuery function, which, on click, itercepts a clicked link:
$("a").click(function(e) {
    e.preventDefault();
    var link = $(this).prop('href'); 
    alert(link);
});
and it works properly, but how to pass that link to a PHP variable to 'echo' it later?
I unsuccessfully tried:
$("a").click(function(event) {
    event.preventDefault();
    var link = $(this).prop('href'); 
    <?php $link = .'link'. ?> 
});
I know it may be a silly question, I looked all over the web but I didn't find any proper answer.
 
     
    