我想实现的效果是,点击按钮,给指定的DIV添加 className 等待3秒后删除给这个DIV添加的className ;
我写的代码,老是提示我Uncaught TypeError: undefined is not a function
下面是我的代码,请大神帮忙看看我哪里写错了,谢谢哈;
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>animate.css动画演示_dowebok</title>
<link rel="stylesheet" href="animate.min.css">
<style>
* { margin: 0; padding: 0;}
#dowebok{
width: 400px;
height: 500px;
background-color: #998822;
margin: 100px 0px 0px 200px;
}
</style>
<script>
function getodiv(){
var odiv = document.getElementById('dowebok');
var Bat_1 = document.getElementById('Bas');
odiv.className = 'animated bounce';
setTimeout(function(){
odiv.removeClass('animated bounce');
},3000);
}
</script>
</head>
<body>
<input type="button" value="演示动画" id="Bas" onclick="getodiv()" />
<div id="dowebok">gggg</div>
</body>
</html>
还不如直接用jQuery写,js不熟何必这么难受