web前端,标签切换总结2setTimeout()延时执行clearTimeout()

html>
<html>




<head lang="en">
    <meta charset="UTF-8">
    <title>title>
    <script src="jquery-2.1.4.min.js">script>
head>
<body>
<script>
    $(document).ready(function(){
      $("button").click(function(){
          setTimeout(function() {
              alert("执行了");
          }, 10000 );
      });

    })
script>
<button>按钮button>

body>

html>

参考:api.jquery.com/deferred.promise/

http://www.w3school.com.cn/jsref/met_win_cleartimeout.asp

你可能感兴趣的:(web前端demo)