-
Applying CSS styles with Javascript
I have an instance where I want to apply a style with javascript in
order to override css settings in the stylesheet. (I'm working with an existing css styled menu system trying to collapse unused portions of the tree).
the css settings are along the lines of:
#rootlevel ul ul a {display:none;}
And I want to override with this style
#rootlevel ul ul#selecteditem a {display:block}
but with javascript.
Can this be done? I'm familiar with
object.style.display = 'block';
but how do we get the cascading events in there? Or can I?
-
I have a workaround. Using document.write to write out a...
<style>
#rootlevel ul ul#selecteditem a{display:block;}
</style>
However, I still wonder if you can encapsulate this 'properly' using javascript.
Similar Threads
-
Replies: 5
Last Post: 05-06-2006, 10:22 PM
-
By Michael in forum ASP.NET
Replies: 10
Last Post: 11-08-2005, 01:19 PM
-
Replies: 0
Last Post: 10-25-2005, 07:07 PM
-
By Greg Rothlander in forum ASP.NET
Replies: 0
Last Post: 11-05-2001, 03:25 PM
-
By Murray Foxcroft in forum Web
Replies: 5
Last Post: 11-02-2000, 03:42 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|