Search the blog

To make non-anchor tags work as links add the following jQuery function to your code:

$('[data-href]').on('click', function() {

    window.location = $(this).data('href');


The set up your elements like this:

<div data-href="/some-page.html" class="foo"></div>
Tim Bennett is a freelance web designer from Leeds. He has a First Class Honours degree in Computing from Leeds Metropolitan University and currently runs his own one-man web design company, Texelate.