title: How to get an span from its textnode or text content?
body: <p>I have a form with 3 fields:</p>
  <pre><code>            &lt;form id=&quot;book-form&quot;&gt;
              &lt;div class=&quot;form-group&quot;&gt;
                &lt;label for=&quot;title&quot;&gt;Title&lt;/label&gt;
                &lt;input type=&quot;text&quot; name=&quot;title&quot; class=&quot;form-control&quot; placeholder=&quot;Enter a title&quot;&gt;
              &lt;/div&gt;
              &lt;div class=&quot;form-group&quot;&gt;
                &lt;label for=&quot;author&quot;&gt;Author&lt;/label&gt;
                &lt;input type=&quot;text&quot; name=&quot;author&quot; class=&quot;form-control&quot; placeholder=&quot;Enter the author of the book&quot;&gt;
              &lt;/div&gt;
              &lt;div class=&quot;form-group&quot;&gt;
                &lt;label for=&quot;isbn&quot;&gt;ISBN#&lt;/label&gt;
                &lt;input type=&quot;text&quot; name=&quot;isbn&quot; class=&quot;form-control&quot; placeholder=&quot;Enter the book isbn&quot;&gt;
              &lt;/div&gt;
              &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary btn-block&quot;&gt;Add Book to store&lt;/button&gt;
          &lt;/form&gt;
  </code></pre>
  <p>Here are I am retrieving the value of these fields that I will insert in their respective span in the html.</p>
  <pre><code>const title = document.getElementsByName('title')[0].value
  const author = document.getElementsByName('author')[0].value
  const isbn = document.getElementsByName('isbn')[0].value
  </code></pre>
  <p>Now I have three span tags where the value of these form fields are suppose to be inserted.</p>
  <pre><code>&lt;span class=&quot;title&quot;&gt;// the value of title&lt;/span&gt;
  &lt;span class=&quot;author&quot;&gt;// the value of author&lt;/span&gt;
  &lt;span class=&quot;isbn&quot;&gt;// the value of isbn&lt;/span&gt;
  </code></pre>
  <p>Now I have a function that checks if the retrieve from the fields of the form is not empty(null) if that is the case I want to remove the span that is was suppose to be in the dom.</p>
  <pre><code>function insertMe(fieldValue) {
  if (fieldValue === &quot;&quot;) {
      // How to remove the span that it was suppose to go
  } else {
      return fieldValue
  }
  </code></pre>
  <p>}</p>