You can see in the headline what it is. I've four div, and therein are each a p tag. When I go with the mouse on the first div, changes the opacity of the p tag of the first div. The problem is when I go on with the mouse on the second or third div only changes the tag p from the first div. It should changes the their own p tags.
And it is important, that i cannot use CSS :hover.
The problem is clear, it is that all have the same id.
I need a javascript which does not individually enumerated all the different classes.
I' sorry for my english.
I hope you understand me.
My script:
<div onmouseout=normal(); onmouseover=hover(); >
<p id=something>LOLOL</p>
</div>
<div onmouseout=normal(); onmouseover=hover(); >
<p id=something>LOLOL</p>
</div>
<div onmouseout=normal(); onmouseover=hover(); >
<p id=something>LOLOL</p>
</div>
<div onmouseout=normal(); onmouseover=hover(); >
<p id=something>LOLOL</p>
</div>
Javascript:
function normal() {
var something = document.getElementById('something');
something.style.opacity = 0.5;
}
function hover() {
var something = document.getElementById('something');
something.style.opacity = 1;
CSS:
p {
opacity: 0.5;
color: red;
}