Skip to content

Instantly share code, notes, and snippets.

@jalotra
Last active August 27, 2023 05:05
Show Gist options
  • Save jalotra/68b08ccee539dca8926a58d062a8e6f2 to your computer and use it in GitHub Desktop.
Save jalotra/68b08ccee539dca8926a58d062a8e6f2 to your computer and use it in GitHub Desktop.
var form = document.querySelector("form");
var nextBtn = form.querySelector(".nextBtn");
var backBtn = form.querySelector(".backBtn");
var allInput = form.querySelectorAll(".input-field");
nextBtn.addEventListener("click", () => {
allInput.forEach(input => {
if(input.value !== ""){
form.classList.add('secActive');
}else{
form.classList.remove('secActive');
}
})
})
backBtn.addEventListener("click", () => form.classList.remove('secActive'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment