1. <html> 
  2. <head> 
  3. <script type="text/javascript"> 
  4. <!-- 
  5. function one(){ 
  6.   document.getElementById('ok').style.background='url(http://d.lanrentuku.com/down/png/1205/angrybirds.jpg)'
  7. function two(){ 
  8.   document.getElementById('ok').style.background='url(http://d.lanrentuku.com/down/png/1110/angry_birds.jpg)'
  9.  
  10. function first(){ 
  11.   document.yes.src='http://d.lanrentuku.com/down/png/1205/angrybirds.jpg'
  12. function second(){ 
  13.   document.yes.src='http://d.lanrentuku.com/down/png/1110/angry_birds.jpg'
  14. //--> 
  15. </script> 
  16. </head> 
  17.  
  18. <body> 
  19. <div id="ok" onMouseover="one()" onMouseout="two()" style="height:150px;width:550px;border:1px solid #ccc;background:#ddd">通过获取id变换</div> 
  20. <hr /> 
  21.  
  22. <a href="#"> 
  23.     <img src="http://www.baidu.com/img/baidu_jgylogo3.gif" name="yes" onmouseOver="first()" onmouseOut="second()" border="0" /> 
  24. </a> 
  25. </body> 
  26. </html>