title: how can i enter keyboard events
body: <p>I was working on this project of UFO, Now I want to move this UFO by using arrow keys Up, Down ,left , right. I am unable to do so</p>
  <pre><code>function Up() {
      if ((pos) &gt;=10) {
        pos -= 5;
        document.querySelector
        document.querySelector(`img`).style.top = pos + &quot;px&quot;;
      }
    }
  
    function Down() {
      if ((pos) &lt;=870) {
        pos += 5;
        document.querySelector(`img`).style.top = pos + &quot;px&quot;;
      }
    }
    function Left() {
      if ((posLeft) &gt;= 10) {
        posLeft -= 5;
        document.querySelector(`img`).style.left = posLeft + &quot;px&quot;;
      }
    }
    function Right() {
      if ((posLeft) &lt;= 1880) {
        posLeft += 5;
        document.querySelector(`img`).style.left = posLeft + &quot;px&quot;;
      }
    }
  </code></pre>