<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Document</title> <style> #hs { width: 200px; height: 200px; background: gray; } </style> <script> var an1 = document.getElementById("an"); function rec() { var bs = document.getElementById("hs"); bs.style.background = "red"; } an1.onmouseover = rec; </script> </head> <body> <input id="an" type="button" value="按钮" /> <div id="hs"> </div> </body> </html>
Anyone
相关分类