移动端实现类似hover事件

移动端在点击按钮瞬间

document.body.addEventListener('touchstart', function(){ 
document.getElementsByClassName('searBtn')[0].style.background='#fff';
});

移开按钮的瞬间

document.body.addEventListener('touchend', function(){ 
document.getElementsByClassName('searBtn')[0].style.background='#0089de';
});
小彭子 <br> 记性不太好的<br>前端开发妹子一枚 <br> 博客记录前端知识学习<br>笔记和平时生活七七八八