I'm pretty sure this isn't possible, but does anyone know if its
possible to add the !important declaration to a style set with script,
as in:

document.getElementById("mydiv").style.height = hvar + "px !important";

When would this ever be necessary? Do you have a test page we could look at?


When you set an attribute of the style object, you are essentially declaring a new value that is last in the cascade. It should override anything else that is not set with !important. So if you are finding that you need to use !important in the scripting, I suspect you might find it easier to search back through the CSS and remove those !important declarations that you don't need.

That said, you might have better luck using the IE "runtimeStyle" object instead for that browser.

--

        Ben Curtis : webwright
        bivia : a personal web studio
        http://www.bivia.com
        v: (818) 507-6613



******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************



Reply via email to