Jump to content

Question


Recommended Posts

Hey Everyone,

I am new here as well as a new coder. I'm still learning some new languages and need some help with something. I was wondering if anyone knew how to code a script that allowed an image to change into another image when clicked. (for example, Lets say your on a forum. You just received a new message and the "Message" image in the header is blinking. Allowing you to know you have a new message. As soon as you click it, The "Message" image in the header goes back to normal.) Does anyone know how you would code that script? I'm really stuck here.

Thanks,

Kevin

Link to comment
https://forums.phpfreaks.com/topic/116928-question/
Share on other sites

http://www.google.com/search?hl=en&safe=off&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=javascript+change+an+image+src

 

Wow, that was hard!

 

 

 

Anyway, now that I'm done being mean:

 

<img src="blah.bleh" onclick="this.src='other.bleh';" />

 

And the src change could of course be wrapped in a function.

Link to comment
https://forums.phpfreaks.com/topic/116928-question/#findComment-601302
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.