Click to See Complete Forum and Search --> : button change


Chrisfree
05-01-2003, 04:22 AM
Hello,

I'm fairly new to JS and I'm trying to do something simple, but I can't work it out. Could you help me please.
I want to change a picture onClick, which bit works. Then I want a new button to appear in place of the old one to say to go back to the original picture... So I do manage to change once but I can't find a way, to change the button value when I want to return... I hope this sound clear!

Help me please!!!
Thanks a lot!
p.s. I tried to look for a solution on this website, but couldn't find something related... I will be grateful for any link too!!!

Asch
05-01-2003, 04:43 AM
Hi, try something like that !...

------------

function movepic(img_name,img_src) {
document[img_name].src=img_src;
}

--------------

be sure to give each image a name & in the onmous tags...

have fun

asch

:D

Chrisfree
05-01-2003, 04:48 AM
but is this for image only?
because I don't have a problem with the image, but the button!

Sorry if I wasn't clear...:p

beebob
05-01-2003, 04:49 AM
forget it ... :D

Chrisfree
05-01-2003, 04:51 AM
why should I?
I like challenges! :rolleyes:

beebob
05-01-2003, 05:05 AM
lol, sorry i updatet the post before. not ment the 'challenge' :D

Chrisfree
05-01-2003, 05:11 AM
no problem... can you help though?:p

beebob
05-01-2003, 05:23 AM
you want do change the image of a formular button?

Chrisfree
05-02-2003, 02:58 AM
hello,

the image change is no problem...
the problem is that when you click on the button and the image changes I would like the button to have a different value and when I click on it the second time, the image should change again... so it is a button problem really:o