Search code examples
htmlclickable

Clickable DIV or A tag?


I have a box on my homepage marked up with the following code:

<div class="panel radius">
    <h3>Lorem ipsum dolor</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit curabitur elit libero, porta condimentum lobortis laoreet, faucibus eget.</p>
</div>

I want to make the whole box clickable. Would it be better to change the DIV to an A tag or use jQuery to make the DIV clickable? Just looking for the best solution.


Solution

  • <script type="text/javascript">
        $(document).ready(function(){
            $(".panel radius").click(function(){
                window.location = URL; 
            });
        });
    </script>
    

    DEMO