onmouseover="this.style... is working but I need something like onmouseover="this.child.child
html, javascript
Solution
Modifying your code
<div class="pdf-icon-box" style="position:relative;" onmouseover="this.getElementsByClassName('name')[0].style.backgroundColor = 'yellow'"; onmouseout="this.getElementsByClassName('name')[0].style.backgroundColor = 'green'"; >
<span class="pdf-style">
<span class="name" style="display:inline-block;background-color:orange;"> T E S T </span>
</span>
</div>
Demo: Fiddle
Problem
Should be verry easy but I can't get it to work. As described in the title I would like to change onmouseover the background-color from span.name (orange) ``` <div class="pdf-icon-box" style="position:relative;" onmouseover="this.style.backgroundColor = 'yellow'"; onmouseout="this.style.backgroundColor = 'green'"; > <span class="pdf-style"> <span class="name" style="display:inline-block;background-color:orange;"> T E S T </span> </span> </div> ``` I found this but coul'd not get it to work Get Element By using Class name This is what I'm trying: fiddle is here It only has to work in FF Thanks for help!