Here my code
<a target="_blank" href="#" onclick="window.open('https://www.google.com','_blank');">
<img src="#{request.contextPath}/resources/img/landing-page/terdaftar-kominfo.png" />
</a>
Here my code
<a target="_blank" href="#" onclick="window.open('https://www.google.com','_blank');">
<img src="#{request.contextPath}/resources/img/landing-page/terdaftar-kominfo.png" />
</a>
You don't need to use Javascript (onclick
). The HTML tag target="_blank"
already means "Open the link in a new tab" :
<a target="_blank" href="https://www.google.com">
<img src="https://via.placeholder.com/150" />
</a>
Note that the link doesn't work here, in the snippet, probably because it's sandboxed. But try it from an HTML file and it will work.