$("a.fav").click(function(e){ e.preventDefault(); var bookmarkUrl = this.href; var bookmarkTitle = this.title; if (window.sidebar) { //for firefox window.sidebar.addPanel(bookmarkTitle, bookmarkUrl,""); } else if( window.external || document.all) { //for IE window.external.AddFavorite( bookmarkUrl, bookmarkTitle); } else if(window.opera) { // for Opera $("a.fav").attr("href",bookmarkUrl); $("a.fav").attr("title",bookmarkTitle); $("a.fav").attr("rel","sidebar"); } else { alert('Your browser dont support'); return false; } });