Javascript Bookmarklet For Generating Link To Current Page With Title Attribute

I wrote a small JavaScript bookmarklet to generate the HTML code for a link to the current page open in a browser, including the page's title attribute.

javascript:var url=document.location;
var title=document.title;
var link='<a href="' + url + '" title="' + title + '"></a>';
alert(link);