I am trying to execute a function when a button is clicked, so with jQuery I tried to get my button element, and then execute my function when I click it, and I want to set the display property of a text to "none", and jQuery keep telling me:
cannot change display style of undefined
I have verified that my jQuery is the first script to be loaded on my page, I have read a lot of forms but I can't figure out what I messed up. Can somebody help me?
my HTML:
<h1 id="intro-txt1">
Welcome to <img src="logo.png" alt="Alcanderia Logo">lcanderia <br>
<button id="discover-button">▶ Discover</button>
</h1>
my JS:
$('#discover-button').click(function() {
$('#discover-video').style.display = "inline";
$('#discover-video').play();
$('#intro-txt1').style.display = "none";
$(".header-container").style.top = "-15vh";
}