notemarklet: Transform selected element into a sticky note

Bookmarklets are nothing new but I never created one. There are tons of available bookmarklets to make tons of useful little things but here is my little but nice bookmarklet :) called notemarklet that helps reading marking the element under the mouse and changing its looks as a sticky note. Next there are a couple of samples:

As you can see notemarker can help you reading text pages. It is a pure JavaScript code without the need of external libraries. So not expect great effects.

Next is the source code.

To use this bookmarlet simply create a new bookmark on your broser and paste the next code as URL. Looking at source code, you can learn how to get the current target element under the mouse, its position, dimensions, etc.

javascript:(function() {

    if (!window.notemarkletDiv) {
        window.notemarkletDiv = {};

    var notemarklet = window.notemarklet;
	var notemarkletDiv = null;

	function createnotemarkletDiv() {
        notemarkletDiv = document.createElement('div'); = 'absolute'; = 'none'; = '1px solid #DEE184'; = '1px'; = '0px'; = '0px'; = '#F4F39E'; = '0.4'; = 9999; = '3px 3px 6px #000'; = '3px 3px 6px #000'; = '3px 3px 6px #000'; = '-webkit-gradient(linear, 0% 0%, 0% 100%, from(#EBEB00), to(#C5C500))';

	var previousTarget = null;
	function notemarkElement(event) {
		if(!notemarkletDiv) {
			previousTarget = target; = 'none';

			var target =;
			var targetRect = target.getBoundingClientRect(); = ('px'; = (window.pageXOffset+targetRect.left-5)+'px'; = (targetRect.right-targetRect.left+10)+'px'; = ('px';
		}, 200);
		setTimeout(function(){ = 'block';
		}, 500);

	document.addEventListener('mousemove', notemarkElement, false);

I think code is really simple and self explanatory. Only note the use of  getBoundingClientRect function to get target position and dimension. Also, take into account, to avoid modifying the target element we create a new div element that overlaps the target.

Simple, easy and useful... anything more?