Koodilistaus:URL in Tooltip.js

Mummilan wikistä
Versio hetkellä 9. marraskuuta 2011 kello 20.52 – tehnyt Jani Uusitalo (keskustelu | muokkaukset) (Tekstin korvaus – ”<metadesc content="([^"]*)" \/>” muotoon ”<metadesc>$1</metadesc>”)

<metadesc>A Greasemonkey JS snippet to show the URL of links in tooltips</metadesc> Download: [{{#file: URL in Tooltip.js}} URL in Tooltip.js]

This is a Greasemonkey JS snippet to show the URL of links in tooltips (instead of what's set by the title attribute). I take no credit for this, as I just c&p'd it from a thread over at Mozilla forums.

{{#fileanchor: URL in Tooltip.js}}

// ==UserScript==
// @name           URL in Tooltip
// @namespace      mariginari
// @description    Show link url in tooltip
// @include        http*
// ==/UserScript==

(function(){
var e=document.getElementsByTagName('a');
for(var i=0;e[i];i++){ e[i].setAttribute('title',e[i].href); }
})()