Saturday, 12 August 2017

How to open link of anchor tag on click of another div

<div class="nv"> click here </div>
 <a class="info_link" href="https://www.google.co.in/?gws_rd=ssl"> demo link</a>


<script>
      $(document).ready(function(){
    $(".nv").click(function() {
    var link = $(this).siblings("a").attr('href');
    window.location.href=link;
});
});
</script>

No comments:

Post a Comment