<!DOCTYPE html>
<html>
<head>
<script src="http://www.sargonco.com/Uploads/Public/article/webdistut/javascript/jquery-3.2.1.min.js"></script>

<script>
$(document).ready(function(){
    $("button").click(function(){
        alert($("#w3s").attr("href"));
    });
});
</script>
</head>
<body>

<p><a href="https://www.w3schools.com" id="w3s">W3Schools.com</a></p>

<button>Show href Value</button>

</body>
</html>

W3Schools.com