How can I get an image to have it's own hyperlink that is inside of a clickable div?

<div id="clickable" onclick="window.open('http://www.daniweb.com');return false;">

  <p>I love clickable images!</p>
    <a href="http://www.google.com"><img src="someimage.png" /></a>
  <p>too bad they don't click in a clickable div</p>


If I try the above then the DIV is always getting the click, never the image in the div. I can click the image, but the link for the div is what opens. Removing the return false does not help either.

Edited by SolidSolutions: more detail

5 Years
Discussion Span
Last Post by SolidSolutions
Featured Replies
  • try [CODE] <img src="img.jpg" onClick="window.open('http://www.daniweb.com')" /> [/CODE] i think it should work fine Read More

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.