$(document).ready(function() { var n = $('span.input').find('input:checked'); n.each(function(index) { var toggle = $(this).parents('.blind'); $(toggle).children('.input').show(); $(toggle).children('.toggle-close').removeClass("toggle-close").addClass("toggle-open"); }); $(".blind > span.prompt").click(function() { $(this).nextAll('.input').toggle(); $(this).toggleClass('toggle-open toggle-close'); }); $('p.blind span.checkboxLabel').html(function(index,html){ return html.replace(/ /,''); }); });