| Refresh | Home EGTry.com

change a html element's classname dynamically


CommentsHTML sourcedisplay in your current browser
please mouse over to the blue letter X
<style type="text/css">
.one {color:red}
.two {color:blue}
</style>

<font title="110">Y</font>
=<font 
title="X=100" 
class="one"
onmouseover="this.innerHTML='100';this.className='two'" 
onmouseout="this.innerHTML='X'; this.className='one'"
>X</font>
+10;

Y =X +10;