Click to See Complete Forum and Search --> : IE <--> Mozilla ???


mini_dumbo
12-05-2002, 03:03 PM
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

gil davis
12-05-2002, 03:54 PM
<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.