最终效果
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<h2></h2>
</body>
</html>
<script src="js/jquery-1.8.3.min.js"></script>
<script>
var count = 0;
function begin() {
if (! (count > 80)) {
$("h2").text(count + " %");
setTimeout("begin()", 30);
}
count++;
}
$(document).ready(function() {
begin();
});
</script>