When disabling an element with Javascript it doesn't apply styles

MonicaP

New Member
In my CSS I am trying to style some \[code\]input\[/code\]s with the following:\[code\]input[disabled="disabled"], input[disabled="true"] { [... styles ...]}\[/code\]This works fine and dandy when I add \[code\]disabled="disabled"\[/code\] straight to the HTML, however when I run the following JS:\[code\]document.getElementById('id').disabled = true;\[/code\]The form field is disabled (i.e. can't focus it), but the styles are not changed. Why is this?
 
Back
Top