// Delete Bookmark
function deleteBookmark(url) {
// Get bookmark from local storage
var bookmarks = JSON.parse(localStorage.getItem('bookmarks'));
// Loop through bookmarks
for(i = 0; i < bookmarks.length; i++) {
if(bookmarks[i].url === url) {
// Remove from array
bookmarks.splice(i, 1);
}
}
// Re-set to local Storage
localStorage.setItem('bookmarks', JSON.stringify(bookmarks));
// Re-fetch bookmarks
fetchBookmarks();
}