Solved

Changing an Image

Posted on 2013-05-17
3
253 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
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…

734 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