How to use both onclick and target="_blank"
Instead use window.open()
:
The syntax is:
window.open(strUrl, strWindowName[, strWindowFeatures]);
Your code should have:
window.open('Prosjektplan.pdf');
Your code should be:
<p class="downloadBoks"
onclick="window.open('Prosjektplan.pdf')">Prosjektbeskrivelse</p>
Just use window.open()
:
window.open('Prosjektplan.pdf')
Anyway, what guys are saying on comments is true. You better use <a target="_blank">
instead of click events.
onclick="window.open('your_html', '_blank')"