DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   JavaScript / DHTML / AJAX (http://www.daniweb.com/forums/forum117.html)
-   -   image as link (http://www.daniweb.com/forums/thread147762.html)

mohammed2raja Sep 26th, 2008 2:53 am
image as link
 
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.

Shanti Chepuru Sep 26th, 2008 4:40 am
Re: image as link
 
put this
<img src="downArrow.gif">
in
<a href...></a>
and then use onclick function.....


All times are GMT -4. The time now is 3:41 pm.

Forum system based on vBulletin Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
©2003 - 2010 DaniWeb® LLC