Call javascript right after the form elements are rendered
You need to wait for the DOM to be ready (i.e. when then browser has finished comprehending the HTML).

Drupal's javascript API provides a natural place for your code, in the form of a behavior, e.g.

(function($) {
  Drupal.behaviors.mymoduleFoo = {
    attach: function(context, settings) {
      $('#priority-6').show();
      // ...
    }
  };
})(jQuery);


The attach method is invoked when the DOM is ready, and also at other points in the page execution when something might have changed (e.g. when an AJAX call is made), to give you the opportunity to respond to any new/change elements that might affect your code's functionality.