is this possible to bookmark a page with html button?
<button>Bookmark This page</button>
function onclickfunction(){
alert('Press Ctrl + D to bookmark this page');
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button onclick="onclickfunction()">Bookmark this page</button>
this code instruct you to how to bookmark a page in chrome. but i want to open a dialog box where we press finished in google chrome.
To create a bookmark link in HTML, you need to create a bookmark using the <a> tag name attribute. Now, add a link to the bookmark. Bookmarks are also known as named anchors. This is quite useful to take readers to a specific section of the web page.
Creating bookmarks in HTML is a two-step process. Here are the steps to follow: Set a bookmark using the id attribute of the HTML tags, such as <h2> , <p> , and so on. Link the HTML tag created, using an anchor tag, <a> , and the href attribute.
Enter <a href="#TopBookmark">Back to Top</a> to create a text link to the bookmark. Verify that the exact bookmark name follows the “#” sign. Use any text for the link; simply insert it within the “a href” tag.
To create a button link to another page in HTML,just add <a> tag and wrap it around the simple Html button. Inside a <a> tag simply use href=“” attribute to give the path of the desired page. The output shows that, after clicking the “Click” button, you will be navigated to “Google” instantly.
Open Google Chrome ( ). Type your login URL into the address bar at the top of your browser window, then press Enter on your keyboard. Once the login page loads, click on the star icon in the top right of the address bar. Give the bookmark a name, and select a location where you would like the bookmark saved.
$(function() {
$('#bookmarkme').click(function() {
if (window.sidebar && window.sidebar.addPanel) { // Mozilla Firefox Bookmark
window.sidebar.addPanel(document.title, window.location.href, '');
} else if (window.external && ('AddFavorite' in window.external)) { // IE Favorite
window.external.AddFavorite(location.href, document.title);
} else if (window.opera && 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.');
}
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<a id="bookmarkme" href="#" rel="sidebar" title="bookmark this page">Bookmark This Page</a>
Use this script to bookmark your page, you can reference here bookmark a url
[Original URL now redirects to a scam website that hijacks the browser's back button.
Original URL was: http://www.developersnippets.com/2009/05/10/simple-bookmark-script-using-jquery/
]
$("button").click(function(e){
e.preventDefault(); // this will prevent the anchor tag from going the user off to the link
var bookmarkUrl = "your_bookmark_url";
var bookmarkTitle = "your_bookmark_title";
if (window.sidebar) { // For Mozilla Firefox Bookmark
window.sidebar.addPanel(bookmarkTitle, bookmarkUrl,"");
} else if( window.external || document.all) { // For IE Favorite
window.external.AddFavorite( bookmarkUrl, bookmarkTitle);
} else { // for other browsers which does not support
alert('Your browser does not support this bookmark action');
return false;
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With