title: How to create a "Bookmark this page" button?
body: <p>I setting up a website and would like to add a simple button to allow a visitor add my page to their bookmarks/favorites. There is a way to do this using javascript? And there is a cross-browser solution?</p>
  
  <p>All of previous answers in Stack Overflow doesn't work anymore, tried all of most recent and some of really old of them, but had no success. This is not a duplicate question.</p>
  
  <p>I tried a lot of solutions, but the last one was:</p>
  
  <pre><code>$(function() {
    $('#bookmarkme').click(function() {
      if (window.sidebar &amp;&amp; window.sidebar.addPanel) { // Mozilla Firefox Bookmark
        window.sidebar.addPanel(document.title, window.location.href, '');
      } else if (window.external &amp;&amp; ('AddFavorite' in window.external)) { // IE Favorite
        window.external.AddFavorite(location.href, document.title);
      } else if (window.opera &amp;&amp; window.print) { // Opera Hotlist
        this.title = document.title;
        return true;
      } else { // webkit - safari/chrome
        alert('Press ' + (navigator.userAgent.toLowerCase().indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL') + ' + D to bookmark this page.');
      }
    });
  });
  
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;a id="bookmarkme" href="#" rel="sidebar" title="bookmark this page"&gt;Bookmark This Page&lt;/a&gt;
  </code></pre>