| index.md - sites - public wiki contents of suckless.org | |
| git clone git://git.suckless.org/sites | |
| Log | |
| Files | |
| Refs | |
| --- | |
| index.md (635B) | |
| --- | |
| 1 Prevent "target" attribute | |
| 2 ========================== | |
| 3 | |
| 4 Description | |
| 5 ----------- | |
| 6 | |
| 7 This script looks for links with "target" attribute set to "_blank" and … | |
| 8 | |
| 9 Author | |
| 10 ------ | |
| 11 | |
| 12 Dmitrij D. Czarkoff <[email protected]> | |
| 13 | |
| 14 Code | |
| 15 ---- | |
| 16 | |
| 17 function untarget() { | |
| 18 var links = document.getElementsByTagName('a'); | |
| 19 Array.prototype.slice.call(links).forEach(function(ancho… | |
| 20 if (anchor["target"] == "_blank") | |
| 21 anchor.removeAttribute("target"); | |
| 22 }); | |
| 23 } | |
| 24 | |
| 25 window.onload = untarget; |