I'm wondering how I would get an element's value like you would set a style with CSS.
eg
HTML Code:
<p id="para"><a href=""><img src=".jpg" /></a></p>
using CSS:
Code:
p#para a img { border: 2px solid black; }
Is it possible to use this method (Which I don't know any terms for) in Javascript? I only know the basic DOM method:
document.GetElementById("para").value;
I'm wondering how you would go about doing the same thing above in CSS, something like this [in theory]
document.getElementById("para").a.img.style = "border: 2px solid black;";
I know how I could do workarounds, but I've wondered if this was possible for too long. I just need to know how to do it, I can't search for it because I don't know what this type of method is called.
|