Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <!-- saved from url=(0068)http://www.criarweb.com/artigos/exemplos/jquery/mostrar-ocultar.html -->
- <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <script>
- $(document).ready(function(){
- $('.checkall').on('click', function () {
- $(this).closest('table').find(':checkbox').prop('checked', this.checked);
- });
- $("#teste").click(function(){
- $("#ckb_resp2").prop('checked', true);
- })
- });
- </script>
- </head>
- <body>
- <html>
- <table>
- <tr><td><input type="checkbox" class="checkall"> Check all</td></tr>
- <tr><td><input type="checkbox"> Checkbox</td></tr>
- <tr><td><input type="checkbox"> Checkbox</td></tr>
- <tr><td><input type="checkbox"> Checkbox</td></tr>
- <input id="ckb_resp2" name="ckb_resp" value="1" type="checkbox">
- <br>
- <button id="teste" type="button" class="btn btn-primary">Testeeee</button></center>
- </table>
- <br>
- </html>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment