Hello, I have a question regarding some JavaScript code that I am struggling with.
function login() {
var lgin = document.getElementById("logIn");
lgin.style.display = "block";
lgin.style.position = "fixed";
lgin.style.width = "100%";
lgin.style.height = "100%";
lgin.style.paddingTop = "15px";
}
var lgButton = document.getElementById("openRooms");
lgButton.addEventListener("click", login, false);
<p><a href="#" id="openRooms">Log In</a></p>
<section id="logIn">
<div class="form-style-6">
<h3>Log In</h3>
<form>
<input type="text" name="field1" placeholder="Name" />
<input type="email" name="field2" placeholder="Email Address" />
<input type="password" name="field3" placeholder="Password" />
<input type="submit" value="Submit" />
</form>
</div>
</section>
I am facing an issue where the JavaScript code I wrote is not functioning as expected.
If anyone could help me troubleshoot this, I would greatly appreciate it.