title: Auto search from google after coverting speech to text javascript
body: <p>After some speech-to-text conversion into the $searchText variable, I show a button.</p>
  <p>By clicking this button, you trigger a search from google.</p>
  <p>However, I want to enter a text which automatically starts a search (without clicking on a button).</p>
  <p>Example: If, after 3 seconds, $searchText is not empty, it searches automatically without clicking a button. I am a beginner. Can you help?</p>
  <pre class="lang-js prettyprint-override"><code>$button.addEventListener('click', () =&gt; {
      if ($searchText.value !== '') {
          var url = 'https://www.google.com/search?q=' + $searchText.value;
          window.open(url, '_blank');
      }
  });
  </code></pre>