Make a linkable div

A div can be made into a link very simple using javascript using this code:


<div onclick="location.href='http://www.domain.com';" style="cursor:pointer;">CLICK ME</div>

Here everything that is inside this div will be clickable and will poing to http://www.domain.com.
Using cursor: pointer dhe mause will change when it is over the div, just like in a real link.

This entry was posted in Web Design. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>