Div OnClick instead of a href | Quickie

Instead of using the “<a href=” tag to go to another page, you can use the “<div onclick=” to be transferred to another page. This is extremely useful if you have a lot of text and pictures that need to be clicked anywhere wanted. Next is the html code to achieve this:

<div id="div_id" onclick="window.location = 'Your reference here'>
Your text here
</div>

Hope this Quickie was of help 😉

No Responses

Leave a Reply

Your email address will not be published. Required fields are marked *