Welcome to W3Courses
 Like Us on Facebook

Create an Add to Favorite link using Javascript

You can create a link named Add to Favorites and when a user clicks on it, the link will prompt the user to add your site to their favorites. Use the following code to implement this solution:


<!-- //Hide From Old Browsers

/* Do Not Remove the Following Line
   For more scripts visit http://www.w3courses.com

//Change the following link to yours
var link = "http://www.w3courses.com";

//Replace the following link with your title
var title = "W3courses";

function fav()

// End Hide-->

<A HREF="#" onClick="fav();">Add To Favorites</A>