<!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(){
        $("#w3s").attr({
            "href" : "https://www.sargonco.com/jquery",
            "title" : "W3Schools jQuery Tutorial"
        });
    });
});
</script>
</head>
<body>

<p><a href="https://www.sargonco.com" title="some title" id="w3s">sargonco.com</a></p>

<button>Change href and title</button>

<p>Mouse over the link to see that the href attribute has changed and a title attribute is set.</p>

</body>
</html>

sargonco.com

Mouse over the link to see that the href attribute has changed and a title attribute is set.