/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] JS events in IE7

Hi,

I’m developing my 1st web app & wonder if anyone could help with the following.

I have a <div> that is displayed when the user clicks on a <h1>, using the onclick event of <h1>. Within the <div> there is a <select>, when the user selects a specific <option> another <div> is displayed, using the onclick event of the <option>.

This works fine in Firefox, but the 2nd event isn’t fired in IE7 ie clicking on the option in the drop down doesn’t display the 2nd <div>. The problem seems to be related to the fact that the drop down is in a <div> that is being dynamically displayed, as the code works fine when in a <div> that is statically displayed.

Any help would be much appreciated.
thanks
Tom

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FangFeb 09.2009 — Events can not be attached to the option element in IE; use the onchange in select.

IE also requires a value attribute in option to pass values correctly.
Copy linkTweet thisAlerts:
@redFredauthorFeb 09.2009 — Appreciate the reply - this was a new one to me but IE7 working now
×

Success!

Help @redFred 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,
)...