**直接拷贝我的过去**
Documentdiv{
width: 100px;
height: 100px;
display: inline-block;
background: #eaf444
}
.a{
box-sizing: border-box;
}
.border{
border: 1px solid black
}
btn
var btn = document.getElementById('btn');
btn.onclick = function(){
var a = document.getElementsByClassName('a');
for(var i = 0 ; i < a.length;i++){
a[i].setAttribute('class','a border');
(function(i){
setTimeout(function(){
a[i].setAttribute('class','a')
},2000)
})(i)
}
}