title: Why isn't the variable in the function passing to the HTML article?
body: <p>I can get the variable to display in the function as an alert but I can't get the variable to pass to the article.  What am I doing wrong?</p>
  
  <p>I know "a" is holding the correct info because I've displayed it with an alert.</p>
  
  <p>I've tried passing the variable using: placeholderContent.recipientName = a;</p>
  
  <p>I've tried declaring the variable outside and inside the function but that didn't work either.</p>
  
  <p>I've tried making a nested function to pass the variable.</p>
  
  <p>I'm new to javascript and have spent hours researching this and trying different methods and I can't get this to work.  I hope someone can help me!</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 validateForm() {           
                  a = document.forms["inviteForm"]["recipientName"].value;
                  if (a == "") {
                      alert("Name must be filled out.");
                  return false;
                           }
                  document.getElementById("recipientName").textContent = a;
                  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;section id="pageForm"&gt;
              &lt;form action="#" Name=inviteForm onsubmit="return validateForm()"&gt;
                  &lt;label for="recipientName"&gt;Recipient name:&lt;/label&gt;
                  &lt;input type="text" name="recipientName" id="recipientName" placeholder="Enter your Recipient Name" /&gt;
                  &lt;input type="submit" value="submit" /&gt;
              &lt;/form&gt;
          &lt;/section&gt;
  
          &lt;article id="placeholderContent"&gt;
              Hello &lt;span id="recipientName"&gt;&lt;/span&gt;!
          &lt;/article&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The variable recipientName should be displayed on the page after the user inputs the name in the form and clicks on the submit button.</p>