• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 286
  • Last Modified:

Changing an Image

I have an image in a div.  I would like to change that image on an event.

<div class="notice" id="notice"><!--notice Start-->
    <p align="center"><img src="Images/Buttons/BigSearch.png" alt="Ballon" name="ballon" width="318" height="166"
    id="ballon" class="ballon" style="visibility: visible;"  /></p>
	</div><!--notice End-->

Open in new window


I was previously just hidding it or showing it, but now I want to chamge it.
How can I do this?

else {
			$("#ballon").css('visibility','visible'); 
		}

Open in new window

This doesn't work.
$("ballon").("img src="Images/Buttons/BigSearch.png");

Open in new window

0
DS928
Asked:
DS928
  • 2
1 Solution
 
Jagadishwor DulalBraces MediaCommented:
Where is your if condition I thinks it's not so good to write only else and what is the event mousehover or click post the complete code.
0
 
Jagadishwor DulalBraces MediaCommented:
OK One of your solution will be changing src:
$("ballon").attr('src',"Images/Buttons/BigSearch.png");

Open in new window

0
 
DS928Author Commented:
Works perfectly!  Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now