By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,480 Members | 1,215 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,480 IT Pros & Developers. It's quick & easy.

Unable to disable div contents in Firefox 2

P: 1
I have the following piece of code:

Expand|Select|Wrap|Line Numbers
  1. <html >
  2.     <body>
  3.         <div disabled="disabled">
  4.             <input type="checkbox" />Try this
  5.         </div>
  6.     </body>
  7. </html>
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?
Apr 3 '08 #1
Share this Question
Share on Google+
1 Reply


drhowarddrfine
Expert 5K+
P: 7,435
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.
Apr 3 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.