Skip to content

Instantly share code, notes, and snippets.

Last active September 26, 2022 14:02
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
data-id bookmarklet
<!DOCTYPE html>
<meta charset="utf-8">
body { font: 20px monospace; margin: 20px; }
a { border-radius: 5px; background-color: #ddd; padding: 10px;}
<a href="javascript:(function(){ var style = document.createElement(%27style%27), styleContent = document.createTextNode(%27[data-id] { box-shadow: 0 0 2px red !important; } [data-id]:before { content: attr(data-id) !important; display: block !important; position: absolute !important; background-color: red !important; padding: 2px !important; color: white !important; z-index: 9000 !important; pointer-events: none !important; font: 800 12px monospace !important; opacity: 0.8 !important; }%27); style.appendChild(styleContent ); var caput = document.getElementsByTagName(%27head%27); caput[0].appendChild(style); })();">data-id</a>
<span>← drag to your bookmarks bar</span>
Copy link

what does this do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment