<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
#one{
width:150px;
height:25px;
border:1px solid red;
}
#two{
width:500px;
height:500px;
}
</style>
</head>
<body>
<div id="one"><input type="button"οnmοuseοver="show1()"value="篮球"><input type="button"οnmοuseοver="show2()"value="足球"><input type="button"οnmοuseοver="show3()"value="乒乓球"></div>
<div id="two">
</div>
<script>
function show1()
{
var two=document.getElementById("two");
two.setAttribute("style","background-image:url(1.jpg)")
}
function show2()
{
var two=document.getElementById("two");
two.setAttribute("style","background-image:url(2.jpg)")
}
function show3()
{
var two=document.getElementById("two");
two.setAttribute("style","background-image:url(3.jpg)")
}
</script>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
#one{
width:150px;
height:25px;
border:1px solid red;
}
#two{
width:500px;
height:500px;
}
</style>
</head>
<body>
<div id="one"><input type="button"οnmοuseοver="show1()"value="篮球"><input type="button"οnmοuseοver="show2()"value="足球"><input type="button"οnmοuseοver="show3()"value="乒乓球"></div>
<div id="two">
</div>
<script>
function show1()
{
var two=document.getElementById("two");
two.setAttribute("style","background-image:url(1.jpg)")
}
function show2()
{
var two=document.getElementById("two");
two.setAttribute("style","background-image:url(2.jpg)")
}
function show3()
{
var two=document.getElementById("two");
two.setAttribute("style","background-image:url(3.jpg)")
}
</script>
</html>