Web Developer's Room
HOME > DHTML サンプル集 > 基本編     

基本編

文字の色を変える

<html>
<body>

<span onmouseover="this.style.color='blue'" onmouseout="this.style.color='red'">
    →マウスのカーソルをここへ
</span>

</body>
</html>

style.colorで色を設定できます。
例では、「→マウスのカーソルをここへ」がonmouseover時にblue、onmouseout時にredに変わります。

 サンプル




スポンサードリンク


(C) Web Developer's Room All rights reserved.