I have a link inside a clickable div like this:
HTML:
<div onClick="goToCat(2);" class="author-topics-block ">
<a href="http://mywebsite/page/?cat=2">The woman in steel</a>
</div>
CSS:
.author-topics-block {
cursor: pointer;
text-align: center;
line-height:26px;
padding: 0 10px 0 10px;
font-size: 15px;
font-family: Oswald;
border-bottom: 4px solid transparent;
}
JS:
function goToCat(catId) {
window.location.href = "http://mywebsite/page/?cat=" + catId;
}
How do I prevent a click from triggering both on the div and on the link?
I want to keep the tag of the link <a href
for search engines and the referencing.