document ready function if checked
The code below is working like it should.
I need to change the first rule so it checks first if it is checked and then continuous.
- <script src="http://code.jquery.com/jquery-latest.min.js"
- type="text/javascript"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- $('table#pl td#cnc').hide();
-
- $('#hide_cnc').click(function() {
- if ($(this).attr('checked'))
- {
- $('table#pl td#cnc').show();
- }
- else
- {
- $('table#pl td#cnc').hide();
- }
- });
- });
- </script>
I have tried with no succes.:
- <script type="text/javascript">
- $(document).ready(function() {
- if ($(this).attr('checked'))
- {
- $('table#pl td.cnc').show();
- }
- else
- {
- $('table#pl td.cnc').hide();
- }
-
- $('#hide_cnc').click(function() {
- if ($(this).attr('checked'))
- {
- $('table#pl td.cnc').show();
- }
- else
- {
- $('table#pl td.cnc').hide();
- }
- });
- });
- </script>