6
0
Fork 0
3D-Druck_Landingpage/themes/hugo-theme-flat/static/js/layout.js

9 lines
316 B
JavaScript
Raw Normal View History

2024-01-08 20:19:45 +01:00
document.addEventListener("DOMContentLoaded", function() {
document.querySelectorAll('a[href^="http"]').forEach(function(element) {
const myhost = window.location.hostname;
const linkhost=new URL(element.href).hostname;
if(myhost === linkhost) return;
element.setAttribute("target","_blank");
})
});