title: How to modifie this code to work on screen tap on smartphones
body: <p>How to modify this code to work on screen tap on smartphones. it changes the item when pressed space bar on keyboard but I want it to also work when someone just taps on the touch screen.</p>
  
  <pre><code>$(window).keypress(function(e) {
     if (e.which === 32) {
       $("#quote").addClass("reset");
       $("#quote").removeClass("executed");
       $("#writer").toggleClass("fade");
       setTimeout(function(){ 
         $.ajax({
            crossOrigin: true,
            url: "https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&amp;filter[posts_per_page]=1&amp;_jsonp=mycallback",
            dataType:"jsonp"
          });
       }, 1000); 
     }
  });
  
  
  
  
  
  function mycallback(json){
     var quote = json[0];
     $("#quote").html(quote.content)
     $("#writer").html(quote.title)
     $("#quote").addClass("executed");
     $("#quote").removeClass("reset");
     $("#writer").toggleClass("fade");
    }
  </code></pre>