Solved

Changing an Image

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
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…

770 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