Skip to content

Instantly share code, notes, and snippets.

@kaezarrex kaezarrex/index.html
Last active Feb 1, 2017

Embed
What would you like to do?
data-id bookmarklet
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body { font: 20px monospace; margin: 20px; }
a { border-radius: 5px; background-color: #ddd; padding: 10px;}
</style>
</head>
<body>
<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>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.