No show-hide class needed. Just pass in the boolean value for the switch and set the initial state of the div using triggerHandler , which allows you to start the event handler associated with the element, which does not actually affect the state of the element:
$(document).ready(function() { $("#checkbox4").click(function() { $("#checkout-shipping-address").toggle(this.checked); }).triggerHandler('click'); });
Demo: http://jsfiddle.net/nQnDG/3/
source share