[thelist] DOM & CSS

Burhan Khalid burhankhalid at members.evolt.org
Wed Mar 13 20:02:00 CST 2002


Hey Listers :

	I'm hoping that one of those CSS gurus can answer this one for me. I am
trying to use DOM to dynamically change certain CSS properties of an
element. Here is my code :

<script type="text/javascript">

function doMouseClick(element, target) {

document.getElementById("contentBoxContainer").style.border = "1px solid
black";
element.setAttribute("style","border-bottom:1px solid white");

....

</script>

(in the body)

<div id="blah" onclick="javascript:doMouseClick(this,'home')">Home</div>

The first line (document.) works as expected, but the second line does
not give any results. I'm trying to change only the bottom border's
values (and eventually only the top, left and right borders). The
problem is, each of these borders needs to be different, and I don't
know of a way of doing it a la document.getEle.....style.border-left?

Thanks for your input,
Burhan Khalid





More information about the thelist mailing list