MediaWiki:Dec2hex.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Spky (Diskussion | Beiträge) (Die Funktion von freifunk-mainz.de/mac.html im Wiki möglich machen.) |
Spky (Diskussion | Beiträge) K |
||
Zeile 4: | Zeile 4: | ||
if(typeof(elems) != 'undefined' && elems !== null) | if(typeof(elems) != 'undefined' && elems !== null) | ||
{ | { | ||
+ | console.log('elems:', elems); | ||
var i = 0, elem; | var i = 0, elem; | ||
while (elem = elems[i++]) | while (elem = elems[i++]) | ||
Zeile 9: | Zeile 10: | ||
if(typeof(elem) != 'undefined' && elem !== null) | if(typeof(elem) != 'undefined' && elem !== null) | ||
{ | { | ||
+ | console.log('elem:', i, elem); | ||
elem.innerHTML = parseInt(elem.innerHTML, 10).toString(16); | elem.innerHTML = parseInt(elem.innerHTML, 10).toString(16); | ||
} | } | ||
} | } | ||
} | } |
Version vom 27. Juni 2014, 11:41 Uhr
/* Ich konvertiere von Dezimal nach Hexadezimal */
var elems = document.getElementsByClassName('dec2hex');
if(typeof(elems) != 'undefined' && elems !== null)
{
console.log('elems:', elems);
var i = 0, elem;
while (elem = elems[i++])
{
if(typeof(elem) != 'undefined' && elem !== null)
{
console.log('elem:', i, elem);
elem.innerHTML = parseInt(elem.innerHTML, 10).toString(16);
}
}
}