title: Why does my clickable image not work?
body: <p>I am trying to make a version of cookie clicker to practice making games but the important part doesn't work: When you click the cookie, nothing happens?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;link rel='stylesheet' href='style.css'/&gt;
      &lt;script language="javascript"&gt;
  
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id="cookie" style="cursor:pointer"&gt;&lt;img src="http://img1.wikia.nocookie.net/__cb20130827014912/cookieclicker/images/thumb/5/5a/PerfectCookie.png/250px-PerfectCookie.png"&gt;&lt;/div&gt;
      &lt;div&gt;
      &lt;script language="javascript"&gt;
          //variables:
          var cookieClicks = 0;
          var cookieClicked;
          //code:
          var cookie = document.getElementById("cookie").onclick = cookieClicked(){
              return true;
          };         // gets the element
  
          //checks if cookie is clicked + add cookie
          if(cookieClicked === true){
              cookieClicks ++;
          }
          document.write(cookieClicks + " Cookies");
      &lt;/script&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>