i want to replace the text of a html anchor:
Click to go home
now i want to replace the
To reference an element by id, you need to use the # qualifier.
#
Try:
alert($("#link1").text());
To replace it, you could use:
$("#link1").text('New text');
The .html() function would work in this case too.
.html()