/    Sign up×
Community /Pin to ProfileBookmark

IE <–> Mozilla ???

Dear all:

We’ve got a page we’d like to run on both IE and Mozzila, it’s three DIV elements with checkboxes and when the boxes are checked the background color will change individually.
The following code is one of the DIV elements, however it only works on IE but not Mozilla…. is there any cross-browser things that we need to know? or where can we find out more ….
Any help is appreciated!

<div style=”background:yellow;color:black;”>
<input type=”checkbox” name=”food1″ value=”apple” onClick=”Javascript:
if (this.checked)
this.parentElement.style.background=’#99CCFF’;
else
this.parentElement.style.background=’yellow’;
return true;”>
apple</div>

Bo & Vic :p

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisDec 05.2002 — <RANT>Reading the W3C specifications (sometimes not a fun thing) will cure you of IE-only implementations. IE allows just about any kind of poor structure and coding. It makes everyone lazy, and then dependent on IE because any other browser will hack up a furball.</RANT>

By specification, FORM elements are required to be enclosed inside <FORM></FORM> tags (is there an echo in here?). NS 6+ and Mozilla will (properly) ignore the lone checkbox in your page.
×

Success!

Help @mini_dumbo 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 5.16,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...