Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Changing an Image

Posted on 2013-05-17
3
Medium Priority
?
266 Views
Last Modified: 2013-05-17
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
Comment
Question by:DS928
  • 2
3 Comments
 
LVL 15

Expert Comment

by:Jagadishwor Dulal
ID: 39175349
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
 
LVL 15

Accepted Solution

by:
Jagadishwor Dulal earned 2000 total points
ID: 39175367
OK One of your solution will be changing src:
$("ballon").attr('src',"Images/Buttons/BigSearch.png");

Open in new window

0
 

Author Closing Comment

by:DS928
ID: 39175420
Works perfectly!  Thank you.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question