title: How to DOM made select element value from one javascript function to another
body: <p>I want to ask that how can I call the value of select option which i made in the selectInput function and and now i want to call the value of select option value in searchPanel function i made selectInput function return type still i unable to call the value</p>
  <pre><code>    function searchPanel() {
             const div = document.createElement(&quot;div&quot;);
  
             div.appendChild(selectInput());
       }
  
  
  
       function selectInput() {
          const select = document.createElement(&quot;select&quot;);
          select.className = `form-control form-control-sm mb-3`;
          select.id = &quot;disposal-type&quot;;
          select.setAttribute(&quot;name&quot;, &quot;disposal&quot;);
  
                const option_Case = document.createElement(&quot;option&quot;);
                option_Case.appendChild(document.createTextNode(&quot;Case&quot;));
                option_Case.setAttribute(&quot;value&quot;, &quot;Case&quot;);
                select.appendChild(option_Case);
  
                const option_Petition = document.createElement(&quot;option&quot;);
                option_Petition.appendChild(document.createTextNode(&quot;Petition&quot;));
                option_Petition.setAttribute(&quot;value&quot;, &quot;Petition&quot;);
                select.appendChild(option_Petition);
  
  
  
         return select;
        }
  </code></pre>