Solved

onClick event for IMG

Posted on 2003-11-11
2
1,944 Views
Last Modified: 2008-03-06
Hi,
I wrote a simple function (javascript) and am trying to call it
from an Img event onClick, but it isnt working,
(I'm using windows98)
any idea why?
this is the HTML code
<img src="/pics/btnAddToCart.gif" border="0"  align="absbottom" onClick="buy()" >

thanx
0
Comment
Question by:zolpo
2 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 100 total points
Comment Utility
where? Not IE? IE supports the onClick.
in other browsers you may need onKeyUp

ALternatively you might have a problem in function buy()

I would in all cases use

<a href="#"
onClick="buy(); return false"><img src="/pics/btnAddToCart.gif" border="0"  align="absbottom"> </a>
0
 
LVL 1

Author Comment

by:zolpo
Comment Utility
thanx a lot!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now