I have the following code that when I press a <a href
I get the url of it:
<a href="http://localhost/uno/dos.zip">DESCARGAR</a>
and jQuery
$('a').click(function(event) {
var url = $('a').attr('href');
alert(url);
});
The problem is the following: when I press the link in the index.php page that I am making, when I press it, the jQuery function that shows me a url is executed, but this function only takes the value of http://localhost and not the entire url http://localhost/uno/dos.zip that is in the one <a href
above.
Is there any other option besides href?
Check your code because with the one you put the full url should appear.
Here is the working example: