Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const button = document.getElementById('submit-button')
- const name = document.getElementById('yourname').value
- const email = document.getElementById('email').value
- const password = document.getElementById('password').value
- function toggleButton() {
- const name = document.getElementById('yourname').value
- const email = document.getElementById('email').value
- const password = document.getElementById('password').value
- button.disabled
- = !name
- || !email
- || !password
- }
- function login() {
- const name = document.getElementById('yourname').value
- const email = document.getElementById('email').value
- const password = document.getElementById('password').value
- const button = document.getElementById('submit-button')
- const user = JSON.stringify({
- name,
- email,
- password
- })
- const storageObj = JSON.parse(localStorage.getItem(email))
- !storageObj && localStorage.setItem(email, user)
- storageObj.password !== password
- ? alert("WRONG PASSCODE YOU SON OF A BITCH")
- : (() => {
- localStorage.setItem("activeUser", email)
- window.location.href = 'welcome.html'
- })()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement