Javascript to change nested styles
I have a LI with an ID of subnav1. Within that object I have a link object, a.
I know I can change the color of text in LI with
But is there a way - without assigning an id to the link object a - to change all the link colors within the object subnav1?
In CSS we would use
I am trying to do the same thing with Javascript.
SOLVED
I know I can change the color of text in LI with
document.getElementById('snav1').style.c olor="#5378af";But is there a way - without assigning an id to the link object a - to change all the link colors within the object subnav1?
In CSS we would use
#subnav1 a { color: #5378af; }I am trying to do the same thing with Javascript.
SOLVED
