title: How to simulate the Enter button to replicate the submit button?
body: <p>I am making a weather application with a textarea, if you click &quot;submit&quot; you will see the weather results. Now, I want to make it so you can click enter to see the data. this is some code:</p>
  <pre><code>    &lt;section class=&quot;inputs&quot;&gt;
          &lt;input type=&quot;text&quot; placeholder=&quot;Enter any city...&quot; id=&quot;cityinput&quot;&gt;
          &lt;input type=&quot;submit&quot; value=&quot;Submit&quot; id=&quot;add&quot;&gt;
          &lt;button placeholder=&quot;submit&quot; id=&quot;add&quot;&gt;&lt;/button&gt;
      &lt;/section&gt;
  </code></pre>
  <p>This is some javascript code:</p>
  <pre><code>   btn.addEventListener('click', function(){
  
  //This is the api link from where all the information will be collected
  
          fetch('https://api.openweathermap.org/data/2.5/weather?q='+inputval.value+'&amp;appid='+apik)
              .then(res =&gt; res.json())
  
              //.then(data =&gt; console.log(data))
  
              .then(data =&gt; {
  
  //Now you need to collect the necessary information with the API link. Now I will collect that information and store it in different constants.
  
                  var nameval = data['name']
                  var tempature = data['hourly']['pop']
  //Now with the help of innerHTML you have to make arrangements to display all the information in the webpage.
                  city.innerHTML=`Weather of &lt;span&gt;${nameval}&lt;span&gt;`
                  temp.innerHTML = ` &lt;span&gt;${ tempature} &lt;/span&gt;`
  
  
              })
  </code></pre>