David Tibbe: Funktion über nur einen Link

Beitrag lesen

Hallo

if(highStatus==false){
Warum? Mach es doch andersrum, also "if (highStatus)" und dann entsprechend die Abfrage gestalten. Auf diese Weise sparst du einen Vergelich, auch wenns wohl nicht merkbar ist ;)

Ein Paar Code-Stellen

function HighlightTag(tagShow,colorShow) {

[...]

document.getElementsByName(tagShowEinzeln[i1])[i].style.backgroundColor = colorShow;

[...]

else{

[...]

document.getElementsByName(tagShowEinzeln[i1])[i].style.backgroundColor = colorShow;

[...]

<a href="#" onclick="HighlightTag('test','#ff0000'); return false;

Du weist immer Rot als Farbe zu, egal ob die Bedingung nun erfüllt ist oder nicht.

Grüße

David

--
"Nobody will ever need more than 640k RAM!"
1981 Bill Gates