Solved

Changing an Image

Posted on 2013-05-17
3
251 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 500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jquery datable hidden section doesn't submit 2 15
html Uncheck Checkbox 2 25
Javascript 2 24
Search Item in Table 2 22
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

829 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