title: Javascript inline onclick goto local anchor
body: <p>I have a button as an image...</p>
  
  <pre><code>&lt;img src="button.png" /&gt;
  </code></pre>
  
  <p>I need some javascript in an onclick where when click it will navigate to a local anchor. For example:</p>
  
  <pre><code>&lt;img src="button.png" onclick="navigateTo #page10" /&gt;
  </code></pre>
  
  <p>How can I do this?</p>
  
  <p>Update: This is the code I'm using:</p>
  
  <pre><code>onclick="document.location=#goToPage';return false;"
  </code></pre>