Konstantin47,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script>
document.addEventListener( "DOMContentLoaded" , function() {
const spacex = async () => {
const response = await fetch('https://api.spacexdata.com/v4/starlink/');
let data = await response.json();
data = data.map(({id}) => `<p>${id}<\/p>`).join('');
out.insertAdjacentHTML('beforeend', data)
};
btn.addEventListener('click', spacex)
});
</script>
</head>
<body>
<button id='btn'>Ok</button>
<output id="out"></output>
</body>
</html>