I am trying to make a clickable button. In the code down below you can see five buttons. The one I am programming with now is the first one (The one with the "Dropdown1" ID). In the bottom you can see the JavaScript code I use. I don't understand why this doesn't work. For my CSS codes I have created separate files. When I test this on the website, nothing happens when I click the first button. The text that is supposed to show/hide doesn't show/hide.
<div class="ompanama" id="femsteder" class="dropdownmain">
<h1 id="liste-overskrift">5 fine steder i Panama</h1>
<ul id="liste">
<button onclick="Function1" class="dropbtn"><li>San Blas-øyene</li></button><br>
<div id="Dropdown1" class="dropdownContent">
<p>gfghkdfghjkjfdhgkfdhgdkfugh</p>
</div>
<button onclick="Function2" class="dropbtn"><li>Panama City</li></button><br>
<div id="Dropdown2" class="dropdownContent">
<p>gfghkdfghjkjfdhgkfdhgdkfugh</p>
</div>
<button onclick="Function3" class="dropbtn"><li>Gatúnsjøen</li></button><br>
<div id="Dropdown3" class="dropdownContent">
<p>gfghkdfghjkjfdhgkfdhgdkfugh</p>
</div>
<button onclick="Function4" class="dropbtn"><li>Chagres Nasonalpark</li></button><br>
<div id="Dropdown4" class="dropdownContent">
<p>gfghkdfghjkjfdhgkfdhgdkfugh</p>
</div>
<button onclick="Function5" class="dropbtn"><li>Darién Nasjonalpark</li></button><br>
<div id="Dropdown5" class="dropdownContent">
<p>gfghkdfghjkjfdhgkfdhgdkfugh</p>
</div>
</ul>
</div>
<script type="text/javascript">
function Function1() {
var x = document.getElementById("Dropdown1");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
</script>
</body>