html - I want an event on my entire div clickable i.e my page should be redirected on click of a div -
my code:
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-12 indexpointer"> <div class="img-txt-box3"> <h2 class="box-text3"> <a href="@url.action("compare","home")"> just<br> compare </a> </h2> </div> </div> css:
.indexpointer { cursor:pointer; } my question is: when click on link pages can open following link, have kept div clickable, want pages opened on click of div. how can achieve this?
try :
$(".indexpointer").click(function(){ window.location= $(this).find("a").attr("href"); })
Comments
Post a Comment