Change the text of the link and change the value of href's attribute value - Javascript jQuery

Javascript examples for jQuery:Link

Description

Change the text of the link and change the value of href's attribute value

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("a").text("Home");
    $("a").attr("href", "http://java2s.com/");
});// w w w .j a va 2  s .c o  m
</script>
</head>
<body>

<a href="">Learn jquery here</a>

</body>
</html>

Related Tutorials