title: Combine 2 functions into 1
body: <p>How can i combine this functions. Basically, when if the checkbox is clicked, something happens and if the page loads and if the checkbox is already clicked, the same thing happens as the second function.</p>
  
  <pre><code>        $(document).on("click", ".dimensions", function() {
              var size = $('.td-hide');
              if ($('input#dimensions').is(':checked')) {
              size.show();
              $('.single-select-sm').css('width','148px')
              } else {
              size.hide();
              $('.single-select-sm').css('width','230px')
              }
          });
          $(function() {
              var size = $('.td-hide');
              if ($('input#dimensions').is(':checked')) {
              size.show();
              $('.single-select-sm').css('width','148px')
              } else {
              size.hide();
              $('.single-select-sm').css('width','230px')
              }
          });
  </code></pre>