How to load a new URL depending on which div was clicked. Every div has its own URL for loading (in my implementation divs are blog pages).
My JQuery: & My html:
$('.postWraper').click(() => {
window.location = $(this).find('h3').find('a').attr('href');
return false;
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="postWraper">
<h3 class="postTitleH3">
<a href="blog/first-page" class="postTitle">
<%= post.postTitle %>
</a>
</h3>
</div>
<div class="postWraper">
<h3 class="postTitleH3">
<a href="blog/second-page" class="postTitle">
<%= post.postTitle %>
</a>
</h3>
</div>
When I clicked on first or second div it's allways redirect me to first URL. I can't understand why. Please help!