HD_X
09-03-2002, 07:22 PM
I am new to JavaScript programming and CSS. Basically I was wondering if JS can be used to changed the properties defined in a CSS. I can change things if it has an ID. But I havent figured out how to change attributes in a class.
Basically I want to do something like this
<html>
<head>
<style>
.mystyle {color:blue}
</style>
</head>
<body>
<p class="mystyle">Test1</p>
<p class="mystyle">Test2</p>
<script>
//do something to change mystyles's color to red
</script>
</body>
</html>
Thanks,
HD_X
Basically I want to do something like this
<html>
<head>
<style>
.mystyle {color:blue}
</style>
</head>
<body>
<p class="mystyle">Test1</p>
<p class="mystyle">Test2</p>
<script>
//do something to change mystyles's color to red
</script>
</body>
</html>
Thanks,
HD_X