Mario Ahna
Neues Mitglied
Hallo ich würde gerne 2 functions erledigen lassen durch einen button, einmal dass das licht angeht und der hintergrund weiß wird oder gelb oder ähnliches und einmal dass das licht ausgeht und der hintergrund schwarz wird aber ich verstehe nicht wieso es nicht geht [bin neu]
Hier der Code:
Hier der Code:
HTML:
<body style="background-color:black;">
<button onclick="document.getElementById('myImage').src='pic_bulbon.gif'" onClick=pageBackground('white')>Turn on the light</button>
<img id="myImage" src="pic_bulboff.gif" style="width:100px">
<button onclick="document.getElementById('myImage').src='pic_bulboff.gif'">Turn off the light</button>
</body>