Unable to disable div contents in Firefox 2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bgrk
    New Member
    • Apr 2008
    • 1

    #1

    Unable to disable div contents in Firefox 2

    I have the following piece of code:

    [CODE=html]<html >
    <body>
    <div disabled="disab led">
    <input type="checkbox" />Try this
    </div>
    </body>
    </html>[/CODE]

    In IE, the check box is disabled, but not in firefox. It works if disabled attribute is set on checkbox element itself. But in my project, I have number of such checkboxes, so I wanted to know if there was a way to disable the div so that its children too will be disabled? Why isn't the disabled attribute value inherited by the children of div element in firefox?
    Last edited by eWish; Apr 3 '08, 02:51 AM. Reason: Please use code tags
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    Originally posted by bgrk
    In IE, the check box is disabled, but not in firefox.
    Never, ever use IE as a reference for how things should work.
    I wanted to know if there was a way to disable the div so that its children too will be disabled? Why isn't the disabled attribute value inherited by the children of div element in firefox?
    Attributes in HTML are not inherited. There is no such thing as a 'disabled' attribute on <div>. So you are asking Firefox to do something against the standard. Never, ever trust IE.

    Comment

    Working...