记住:移动元素都是移动元素的定位left 和top的值
步骤: 1 .获取元素
2.设置全局的盒子的left值 css设置多少 var 多少
3.添加点击事件 点击button 移动div
html代码:
<style>
#box {
position: absolute;
top: 100px;
left: 100px;
width: 100px;
height: 100px;
background-color: orange;
}
</style>
<button id="