<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div class="zxc" style="background-color: red;width: 100px;height: 100px;"></div>
<script type="text/javascript">
setInterval(function(){
var len=10;
document.querySelector('.zxc').style.marginLeft = len+'px';
len +=10;
}, 100)
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div class="zxc" style="background-color: red;width: 100px;height: 100px;"></div>
<script type="text/javascript">
var len=10;
setInterval(function(){
document.querySelector('.zxc').style.marginLeft = len+'px';
len +=10;
}, 100)
</script>
</body>
</html>
习惯受伤