Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved

Join Date: Sep 2008
Posts: 25
Reputation: mohammed2raja is an unknown quantity at this point 
Solved Threads: 1
mohammed2raja mohammed2raja is offline Offline
Light Poster

image as link

 
0
  #1
Sep 26th, 2008
I want to make an image as link, such that when I click on the image a javascript function is called. The whole code is written in javascript.
I try this byt it files:
aaa=document.createElement('a');
aaa.href="#";
aaa.innerHTML="<img src="downArrow.gif">";
aaa.onclick=function()
{
moreInfo(this);
}
here I want when I click "doenArrow.gif" image the function "moreInfo()" should be called.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,073
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: image as link

 
0
  #2
Sep 26th, 2008
put this
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <img src="downArrow.gif">
in
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <a href...></a>
and then use onclick function.....
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC