Add content in html by clicking the checkbox

The class may be hiding / showing the content but Gih is right that the code will set the same content over and over when you toggle the checkbox. Here’s how you set different content depending on the checked state.

$("#checkbox4").change(function(event) {
  var html = event.target.checked ? '<p>Content</p>' : '';
  $("#checkout-shipping-address").html(html);
})
1 Like