Setting a css property value to !important with javascript & IE

S

Spartanicus

Setting a css property value to !important like this:

logoDiv.style.top='.5em !important';

causes problems in IE, and afaics style.setProperty() isn't supported by
IE.

Anyone know of a work around for this?
 
M

Michael Winter

On 30/09/2005 22:21, Jim Higson wrote:

[snip]
logoDiv.setAttribute( 'class', logoDiv.getAttribute('class')
+ ' forceimportantstuff' );

Of course, you'll have to deal with the class/className
confusion IE has.

Which is why it is often simpler to avoid the *Attribute methods and use
the property shortcuts.

Mike
 
Joined
Aug 25, 2006
Messages
1
Reaction score
0
I wonder if you found anyway to do this? I'm looking for a solution as well. I can't use a class name and need to set the CSS property directly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top