title: How to get the value of the span element with testid using react testing library?
body: <p>I want to get the value of the span element using react testing library.</p>
  
  <p>What i am trying to do?</p>
  
  <p>I have a span element like below displaying some value</p>
  
  <pre><code>render = () =&gt; {
      const count = 2;
      return (
          &lt;span data-test-id="test-span"&gt;
              {count}
          &lt;/span&gt;
       )
   }
  </code></pre>
  
  <p>Now within my test i access the element like below,</p>
  
  <pre><code>const span_element = getByTestId('test-span');
  </code></pre>
  
  <p>But i am not sure how to retrieve its value.</p>
  
  <p>I tried using span_element.value but says 'property value doesnt exist on HTMLElement"</p>
  
  <p>How can i fix this. could someone help me with this. thanks.</p>