Hey I'm having a problem with the prompt method in Javascript.
What I try to do is make the H1 equal to the user his answer.
The problem is that the function does not take the answer in it's function.
I tried to find something about it on youtube without succes.
Any tips or help would be appreciated
$(document).ready(function() {
console.log('Document loaded');
});
let answer = prompt('name of club?');
function changeDOM() {
$('.front').text(answer);
};
changeDOM();
<DOCTYPE html>
<html>
<head>
<link href="main.css" type="text/css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Anton|Pacifico|Maven+Pro" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="main.js" type="text/javascript"></script>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>HAL Tech</title>
</head>
<body>
<div class="parallax-group">
<h1 class="front">HAL Tech</h1>
<!--
<ul class="nav">
<li href="#">Tech club</li>
<li href="#">Te doen</li>
<li href="#">Projecten</li>
<li href="#">Dingen</li>
</ul>
-->
<img src="POEP.jpg" class="back" alt="">
</div>
</body>
</html>
text('answer')is not equal totext(answer)You are also executing your javascript before your element exists