Olá pessoal tudo bom? então estou tendo problemas para pegar informações de uma página e imprimir as informações em uma página principal, se vocês puderem me ajudar fico muitoo agradecido, segue o código:
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Exercicios HTML</title>
</head>
<body>
<header>
<h1>exercicios HTML</h1>
</header>
<nav>
<a href wm-nav="exercicios/teste.html">00 - teste</a>|
<a href wm-nav="exercicios/temp.html">sem tempor irmao</a>
</nav>
<section id="conteudo"></section>
<footer>
<br>
curso de web moderno
</footer>
<script>
document.querySelectorAll('[wm-nav]').forEach(link => {
const conteudo = document.getElementById('conteudo')
link.onclick = function(e){
e.preventDefault()
fetch(link.getAttribute('wm-nav'))
.then(resp => resp.text())
.then(html => conteudo.innerHTML = html)
}
})
</script>
</body>
</html>


