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 😉

Hello, nice to meet you

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Leave a Reply