Having some issues displaying the #coupon using JavaScript, as I am encountering an error message stating that getElementById is undefined.
Code Snippet (HTML)
<html>
<head>
<title>Exercise</title>
<link rel="stylesheet" href="stylesheet.css">
<script src="javascript.js"></script>
</head>
<body>
<div class="inputi">
<p class="input-text">Une Jam?</p> <input placeholder="Sheno emrin..." type="text" id="inputId">
//checks input value
<button type="button" onclick="getInputValue()">Vazhdo</button>
// shows error message if it doesn't match the array
<p id="message"></p>
</div>
// aiming to showcase this with javascript post login
<h1 id="coupon">You have a giftcard </strong></h1>
<button id="coupon">abas</button>
</body>
</html>
Javascript Section
** the issue: The problem lies in the fact that getElementById is returning as undefined. My goal is to display:block after a successful login attempt. **
var zzz = getElementById("coupon")
if(zzz === "none") {
display:block; }
// document.writeln("<h1>Keni fituar kupon 50% ne <strong> Green & Protein </strong> </h1>");
// document.writeln('<input class="giftcode" placeholder="' +finalcode+'" type="text" id="inputId">');
display_image(images[z], 400, 400, 'Javascript');
document.write('<br>' + user[i]);
}
}
}