title: Is there a way to combine functions for this simple task?
body: <p>I'm a newbie and was wondering, instead of writing this on two separate lines like I have here, can I combine the <code>innerHTML</code> and <code>style</code> properties together on one line? Or is there a more concise way of writing this?</p>
  <p>I know this is a poor example and would  never actually be used, I'm just trying to figure out if there's a way to combine the <code>innerHTML</code> and <code>style</code> (or whatever functions) into one line instead of having two <code>document.getElementById</code>'s.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function myFunction() {
    document.getElementById('test').innerHTML = 'Show this text';
    document.getElementById('test').style = 'display:block';
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#test {
    display: none;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p id="test"&gt;&lt;/p&gt;
  &lt;button onclick="myFunction()"&gt;Click me&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>