Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <TITLE>Javascript Test1</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <SCRIPT language="JavaScript" TYPE="text/JavaScript"> function klick(name){ if(document.getElementById(name).style.backgroundColor == "#FFFFFF"){ document.getElementById(name).style.backgroundColor = "#000000"; }else { document.getElementById(name).style.backgroundColor = "#FFFFFF"; } } </SCRIPT> </HEAD> <BODY> <A HREF="javascript:klick('win1')">Farbe wechseln</A> <DIV ID="win1"> Hallo wie gehts! </DIV> </BODY> </HTML>
Und kennst wer eine andere Lösung für das Problem?
Kommentar