iostream71
Programmer
this is a really bad example, but general idea of what i want to do. trying to change the color of the element's text on a click. will only work if i do it inline. i read about using document.styleSheets[n].cssRules[n], but that wouldn't work either
<head>
<style type="text/css">
p { color:red }
</style>
<script language="javascript">
function changeIt(){
document.getElementById('myId').style.color = "blue";
}
</script>
</head>
.
.
.
<body>
<p id="myId" onClick="changeIt()"> my text </p>
<head>
<style type="text/css">
p { color:red }
</style>
<script language="javascript">
function changeIt(){
document.getElementById('myId').style.color = "blue";
}
</script>
</head>
.
.
.
<body>
<p id="myId" onClick="changeIt()"> my text </p>