Uncaught ReferenceError: cancel is not defined

確認寫法沒出錯後,基本是由於引用js的順序出啦問題 參考寫法html

<!DOCTYPE html>jquery

<html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <!--<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>--> <script src="jquery-1.12.4.min.js"></script> </head> <body> <div> <input type="button" onclick="mao()" value="全選"> <table border="1">code

<thead>
       <tr><th>選項</th><th>ip</th><th>端口</th></tr>
      </thead>
      <tbody>
      <tr><td>  <input type="checkbox"> </td><td>1.1.1.1 </td><td>67</td></tr>
      <tr><td>  <input type="checkbox"></td><td>1.1.1.1 </td><td>67</td></tr>
      <tr><td>  <input type="checkbox"></td><td>1.1.1.1 </td><td>67</td></tr>
      </tbody>
  </table>

</div> <script> function mao() {htm

$(":checkbox").prop('checked',true)
 }
 </script>

</body> </html>ip

相關文章
相關標籤/搜索