/    Sign up×
Community /Pin to ProfileBookmark

Problems with img.onClick event on IE7

Hi,

This code works fine on FireFox:

[CODE] <img src=”/img/provi/benviar.png”
onMouseOver=”this.src=’/img/provi/benviar-over.png'”
onMouseOut=”this.src=’/img/provi/benviar.png'”
onClick=”alert(‘hello’);”/>
[/CODE]

But in IE7 the onClick event is ignored, while onMouseOver and onMouseOut works as expected.

Does someone knows why?

Thanks a lot in advance,

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@fmmarzoaauthorJan 17.2012 — Hmmmmmmm... I think it may be a problem of IETester.

I have test with IE9 tab on IETester and it does not show the alert neither, but an IE9 standalone browser does... O_o
Copy linkTweet thisAlerts:
@007JulienJan 17.2012 — And with an onclick without upper case ?
Copy linkTweet thisAlerts:
@JunkMaleJan 18.2012 — onclick in lowercase
×

Success!

Help @fmmarzoa spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...