Advertisement
shaashwato1308

JavaScript : Showing HTML Content on Checkbox Click

Nov 12th, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     $(document).ready(function() {
  2.         // insulation <-> insulationinside
  3.         $( "#insulation" ).click(function() {
  4.             if($('#insulation').is(":checked")){
  5.                 document.getElementById("insulationinside").style.display = "block";
  6.             }else{
  7.                 document.getElementById("insulationinside").style.display = "none";
  8.             }
  9.         });
  10.         // solar <-> solarinside
  11.         $( "#solar" ).click(function() {
  12.             if($('#solar').is(":checked")){
  13.                 document.getElementById("solarinside").style.display = "block";
  14.             }else{
  15.                 document.getElementById("solarinside").style.display = "none";
  16.             }
  17.         });
  18.         // heating <-> heatinginside
  19.         $( "#heating" ).click(function() {
  20.             if($('#heating').is(":checked")){
  21.                 document.getElementById("heatinginside").style.display = "block";
  22.             }else{
  23.                 document.getElementById("heatinginside").style.display = "none";
  24.             }
  25.         });
  26.         // sinsulation <-> sinsulationinside
  27.         $( "#sinsulation" ).click(function() {
  28.             if($('#sinsulation').is(":checked")){
  29.                 document.getElementById("sinsulationinside").style.display = "block";
  30.             }else{
  31.                 document.getElementById("sinsulationinside").style.display = "none";
  32.             }
  33.         });
  34.         // ssolar <-> ssolarinside
  35.         $( "#ssolar" ).click(function() {
  36.             if($('#ssolar').is(":checked")){
  37.                 document.getElementById("ssolarinside").style.display = "block";
  38.             }else{
  39.                 document.getElementById("ssolarinside").style.display = "none";
  40.             }
  41.         });
  42.         // sheating <-> sheatinginside
  43.         $( "#sheating" ).click(function() {
  44.             if($('#sheating').is(":checked")){
  45.                 document.getElementById("sheatinginside").style.display = "block";
  46.             }else{
  47.                 document.getElementById("sheatinginside").style.display = "none";
  48.             }
  49.         });
  50.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement