title: How to access inner content of div or any element in reactjs using useRef Hook?
body: <p>First of all Greeting from my side
  I am beginner in Reactjs and I am learning a new hook called useRef() hook.
  Basically I am trying to fetch the content of every element present in my div using useRef Hook.
  In my code I need to access the content of only p tag how can I achieve it ?
  This is my Code :-</p>
  <pre><code>import React,{useRef} from 'react'
  
  function FormData() {
      const getAllData = useRef(null)
  
      const onClickHandler = () =&gt;{
          console.log(getAllData.current) 
      }
      
    return (
      &lt;div ref={getAllData} &gt;
          &lt;h1&gt;UseRef Tutorial&lt;/h1&gt;
          &lt;p&gt;Abhishek Poddar&lt;/p&gt;
          &lt;input type=&quot;email&quot;  placeholder='Enter the Email' /&gt;
          &lt;br&gt;&lt;/br&gt;
          &lt;br&gt;&lt;/br&gt;
          &lt;input type=&quot;password&quot; placeholder='Enter the Password' /&gt;
          &lt;br&gt;&lt;/br&gt;
          &lt;br&gt;&lt;/br&gt;
          &lt;button onClick={onClickHandler}&gt;Click Me&lt;/button&gt;
      &lt;/div&gt;
    )
  }
  
  export default FormData
  </code></pre>