Drupal 7 check all solution for 2017, is it possible?
You want to create a custom module for this

my_module.module

function my_module_form_node_form_alter(&amp;$form,&amp;$form_state,$form_id) {
     if($form['#node']-&gt;type == "my_content_type") {
        $form['#attached']['js'][] = array(
          'data' =&gt; drupal_get_path('module', 'my_module') . '/js/example.js',
          'type' =&gt; 'file', 
        );
     }
}



Change all my_module to the actual name of your module
Change my_content_type to the actual name of your content type.


my_module/js/example.js  (using code from the link you gave)

(function ($) {
    Drupal.behaviors.selectAll = {
      attach: function (context, settings) {
        $('body.page-node .form-type-checkboxes &gt; label').click(function() {
            $(this).nextAll('.form-checkboxes').find('input[type="checkbox"]').trigger('click');
        });
      }
    };
}(jQuery)); 


If it doesn't work, try changing the line

$(this).nextAll('.form-checkboxes').find('input[type="checkbox"]').trigger('click');

to 

$(this).nextAll('input:checkbox').trigger('click');