Advertisement
Guest User

Untitled

a guest
Apr 11th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const button = document.getElementById('submit-button')
  2. const name = document.getElementById('yourname').value
  3. const email = document.getElementById('email').value
  4. const password = document.getElementById('password').value
  5.  
  6. function toggleButton() {
  7.     const name = document.getElementById('yourname').value
  8.     const email = document.getElementById('email').value
  9.     const password = document.getElementById('password').value
  10.     button.disabled
  11.         = !name
  12.         || !email
  13.         || !password
  14. }
  15.  
  16. function login() {
  17.     const name = document.getElementById('yourname').value
  18.     const email = document.getElementById('email').value
  19.     const password = document.getElementById('password').value
  20.     const button = document.getElementById('submit-button')
  21.  
  22.     const user = JSON.stringify({
  23.         name,
  24.         email,
  25.         password
  26.     })
  27.  
  28.     const storageObj = JSON.parse(localStorage.getItem(email))
  29.     !storageObj && localStorage.setItem(email, user)
  30.     storageObj.password !== password
  31.         ? alert("WRONG PASSCODE YOU SON OF A BITCH")
  32.         : (() => {
  33.             localStorage.setItem("activeUser", email)
  34.             window.location.href = 'welcome.html'
  35.         })()
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement