Hide objects and sections on page load

  //----- HIDE ALL OPTIONAL WIDGETS AND SECTIONS OF THE PAGE INITIALLY -----
  if (strpos($_SERVER['REQUEST_URI'], 'wp-admin') === False)    //Don't do if we're editing the page design
  {
    $HtmlOutput .= <<<_END
      <style>
        #MyButton1,
        #MyButton2 {
          visibility: hidden;
        }
        #MySection1,
        #MySection2 {
          display: none;
        }
      </style>
_END;
  }

Hide from JavaScript

document.getElementById("my_object_id_value").style.display = "none";