title: Radio Button not performing JavaScript action when clicked
body: <p>I am trying to create a radio button that opens up an additional checkbox. When I run the code, the checkbox is already open. what can I do to fix it?</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-html lang-html prettyprint-override"><code>&lt;script&gt;
    function accountFunction() {
      if (document.getElementById('yesSrm').checked) {
        document.getElementById('acct').style.display = "inline";
      } else {
        document.getElementById('acct').style.display = "none";
      }
  &lt;/script&gt;
  &lt;form&gt;
    &lt;input id="yesSrm" name="yesSrm" type="radio" value="yes" onchange="accountFunction()" /&gt;SRM&lt;br/&gt;
    &lt;br/&gt;
    &lt;div id="acct"&gt;
      &lt;label for="account"&gt;Account&lt;/label&gt;
      &lt;input type="checkbox" name="account" id="account"&gt;&lt;br/&gt;
    &lt;/div&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://i.stack.imgur.com/PRr89.png" rel="nofollow noreferrer">How it appears</a></p>