title: When Click Link Display Image
body: <p>I want an image to get displayed on a page when the user clicks on a certain link that looks like #foo. Example</p>
  
  <pre><code>&lt;a href="#dog"&gt;Dog&lt;/a&gt;
  &lt;a href="#cat"&gt;Cat&lt;/a&gt;
  </code></pre>
  
  <p>If the url contains #dog it will display a picture of a dog. if the url contains #cat it will display a picture of a cat. How can this be achieved. Then have the images be displayed in the image tag. </p>
  
  <pre><code>&lt;img id="something" /&gt;
  </code></pre>
  
  <p><strong>Edit:</strong> I'm thinking of maybe having all images hidden until link id clicked. Then somewho get the url and determine which image to display. The most important part is to do it from identifying the URL</p>
  
  <p>A sudo code idea of what I'm trying to achieve. </p>
  
  <pre><code>    if url = #dog then 
      display in idelement dog.jpg 
      else if url = #cat then  
      display in idelement cat.jpg 
      else display defualt.jpg
  
  
  &lt;img id="idelement" /&gt;
  </code></pre>