varOldcolor;varoldsize;functionClickdiv (obj) {alert (event); Obj.style.color= ' #foo '; Obj.style.fontSize= ' 22px '; /*the Obj.style represents the style property of the object that sets obj. Obj.id indicates that the setting ID Style.color represents a property in the set CSS. Special note, font-size, text-decoration, etc. have the properties of the underlined, the setting needs Hump identification: Fontsize,textdecoration*/}functionmouseover (obj) {oldcolor=Obj.style.color; /*use Font-size to set the font size in CSS, use the Hump logo (others are similar) through JS; */oldsize=obj.style.fontSize; Obj.style.color= ' #foo '; Obj.style.fontSize= ' 22px ';}functionmouseout (obj) {obj.style.color=Oldcolor; Obj.style.fontSize=oldsize;}
<body>
<div onclick = ' Clickdiv (this) ' > click </div>
<div onmouseover = "mouseover (this)" onmouseout = "mouseout (this)" > Mobile </div>
</body>
Simple Event Handling