Login Register


Java script filter_list
Author
Message
Java script #1
Code:
<script> function changeimage() { element = document.getElementById('bulbon'); if (element.src.match("http://www.w3schools.com/js/pic_bulbon.gif")) { element.src = "http://www.w3schools.com/js/pic_bulboff.gif"; } else { element.src = "http://www.w3schools.com/js/pic_bulbon.gif"; } } </script> <script> function changeimage1() { element = document.getElementById('bulbons'); if (element.src.match("http://www.w3schools.com/js/pic_bulbon.gif")) { element.src = "http://www.w3schools.com/js/pic_bulboff.gif"; } else { element.src = "http://www.w3schools.com/js/pic_bulbon.gif"; } } </script> <img src="http://www.w3schools.com/js/pic_bulboff.gif" id="bulbon" onclick="changeimage()" width="150" height="150"<t>> <img src="http://www.w3schools.com/js/pic_bulboff.gif" id="bulbons" onclick="changeimage1()" width="150" height="150">
/* i wrote this script now i want to add a script that if both bulbs are on the image of the background changes and vice versa can you help me please */
//i would be very thankfull


RE: need some help #2
Use code tags for code I've edited it for you this time but in future I expect you to do this yourself.
If you need help feel free to PM me
[Image: klfpJD]
Probitcoin
Freebitcoin
BTC clicks
bitcoin wallet:
1FBPAanbs3rJU9BUpobpDJc9hHUaCaC25N


RE: need some help #3
thank but i would appreciate your help in the program itself if you might ))


RE: need some help #4
I dont do javascript really, but I dont see why you wouldnt do something like

Code:
element = document.getElementById('bulbons'); element2 = document.getElementById('bulbons2'); if (element.src.match("http://www.w3schools.com/js/pic_bulbon.gif") && element2.src.match("http://www.w3schools.com/js/pic_bulbon.gif"))

And obviously fix the rest of the code to reflect the same changes. You'll obviously need to create a second element called bulbons2


RE: need some help #5
yep now i know what i have to do thank you very much :HeartEyes:








Users browsing this thread: 1 Guest(s)