mpalmer12345
Programmer
I am a beginner at this, so bear with me!
I want to set up a function that can be called more than once and operate on each distinct span ID. Something like this, but not just for T0001 but for T0002, T0003, etc.
<html>
<head>
<script type="text/javascript">
<!--
function Test(colorValue)
{
var colorValueHex = '#' + 200 + 200 + 200;
document.getElementById('t0001').style.color = colorValueHex;
}
//-->
</script>
</head>
<body>
<div class="text">
x<span id="t0001" style="color:white;" onMouseDown="Test(255, t0001);">REMEMBER</span>x
</div>
<div class="text">
x<span id="t0002" style="color:white;" onMouseDown="Test(255, t0002);">RECOVER</span>x
</div>
</body>
</html>
I want to set up a function that can be called more than once and operate on each distinct span ID. Something like this, but not just for T0001 but for T0002, T0003, etc.
<html>
<head>
<script type="text/javascript">
<!--
function Test(colorValue)
{
var colorValueHex = '#' + 200 + 200 + 200;
document.getElementById('t0001').style.color = colorValueHex;
}
//-->
</script>
</head>
<body>
<div class="text">
x<span id="t0001" style="color:white;" onMouseDown="Test(255, t0001);">REMEMBER</span>x
</div>
<div class="text">
x<span id="t0002" style="color:white;" onMouseDown="Test(255, t0002);">RECOVER</span>x
</div>
</body>
</html>