Last active
September 18, 2017 13:20
-
-
Save elleryq/877441dbe038f3f798f3b5480dfd68d7 to your computer and use it in GitHub Desktop.
jQuery 1.2 checkbox demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <script src="http://www.google.com/jsapi"></script> | |
| <script type="text/javascript"> | |
| // Load jQuery | |
| google.load("jquery", "1.2"); | |
| </script> | |
| <script type="text/javascript"> | |
| google.setOnLoadCallback(function() { | |
| $("input[name=chk]").change( function() { | |
| $(this).parent().toggleClass( "checked" ); | |
| } ); | |
| $("input[name=chk1]").change( function() { | |
| $(this).parent().parent().children().toggleClass( "checked" ); | |
| } ); | |
| } ); | |
| </script> | |
| <style type="text/css"> | |
| <!-- | |
| .checked { | |
| background-color: #EEEEFF; | |
| } | |
| --> | |
| </style> | |
| </head> | |
| <body> | |
| <p><input type="checkbox" name="chk" value="1"/>Test</p> | |
| <table border='1'><tr><td><input type="checkbox" name="chk1" value="1"/>Test</td><td>second column</td></tr></table> | |
| </body> | |
| </html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment