I want to change the styling of several <div> elements with just one
onMouseOver event.
"getElementsByC lassName" would be ideal if it hadn't been rejected.
I can't seem to make getElementsByTa gName work and all the references I've
seen don't help.
The page in question has a variable number of <div> elements because I
generate it with a server-side vbscript.
I could create sequentially numbered IDs and write a short javascript to
loop through the ID numbers (example below) but is there a more elegant
solution?
eg:
<div id="ref1" class="myclass" ...
<div id="ref2" class="myclass" ...
<div id="ref3" class="myclass" ...
<div id="ref4" class="myclass" ...
<div id="ref5" class="myclass" ...
then
for(i=1;i<=5;i+ +)
{
idRef = "ref" + i
document.getEle mentById(idRef) .style.blahblah blah = morestuf
}
onMouseOver event.
"getElementsByC lassName" would be ideal if it hadn't been rejected.
I can't seem to make getElementsByTa gName work and all the references I've
seen don't help.
The page in question has a variable number of <div> elements because I
generate it with a server-side vbscript.
I could create sequentially numbered IDs and write a short javascript to
loop through the ID numbers (example below) but is there a more elegant
solution?
eg:
<div id="ref1" class="myclass" ...
<div id="ref2" class="myclass" ...
<div id="ref3" class="myclass" ...
<div id="ref4" class="myclass" ...
<div id="ref5" class="myclass" ...
then
for(i=1;i<=5;i+ +)
{
idRef = "ref" + i
document.getEle mentById(idRef) .style.blahblah blah = morestuf
}
Comment