變化顏色按鈕
將下列程式碼複製至<head>程式碼</head>區內。
<script> <!-- function change(color){ var el=event.srcElement if (el.tagName=="INPUT"&&el.type=="button") event.srcElement.style.backgroundColor=color } function jumpto2(url){ window.location=url } //--> </script> <form onMouseover="change('yellow')" onMouseout="change('lime')"> <p align="center"><input type="button" value="Yahoo " class="initial2" onClick="jumpto2('http://yahoo.com')"> <input type="button" value="Geocities " class="initial2" onClick="jumpto2('http://Geocities.com')"> <input type="button" value="ABC News " class="initial2" onClick="jumpto2('http://abcnews.com')"> </form> |
將下列程式碼複製至<body>程式碼</body>之間。
<style> <!-- .initial2{font-weight:bold;background-color:lime} //--> </style> |