Changer la couleur de fonds au survol de la souris
Description | |
---|---|
Publicité |
|
Solution | <!-- Exemple avec onmouseover --> <table> <tr onmouseover="javascript:document.getElementById('idtd').style.backgroundColor='#fafafa';"> <td id="idtd">Texte 1</td> </tr> </table> <!-- Exemple avec onmouseover et onmouseout --> <table> <tr onmouseover="javascript:document.getElementById('idtd').style.backgroundColor='#fafafa';" onmouseout="javascript:document.getElementById('idtd').style.backgroundColor='#fff';"> <td id="idtd" style="background-color:#fff;>Texte 1</td> </tr> </table> |
Notez la solution |
|
Partagez cette question |
|
Questions similaires | Changer une image au survol de la souris |
Mots clés | javascript, onmouseover, onmouseout, background-color, backgroundColor, style, couleur |