Reputation: 23
$(".unfriend").click(function () {
$(".friends_slected").text("Add Friend");
return false;
});
In this .text("Add Friend");
Add Friend text is added from this.... but how can we make this Add Friend an anchor tag not a simple text by using jQuery?
Upvotes: 2
Views: 4750
Reputation: 3272
The html function takes an html string as input. So you just need to do:-
$(".friends_slected").html("<a href='anchor_url'>Add Friend</a>");
Hope that helps.
Upvotes: 1
Reputation: 39278
$(".unfriend").click(function () {
$(".friends_slected").html("<a href='someurl'>Add Friend</a>");
return false;
});
The .html method will let you add arbitrary html to your element
Upvotes: 4