Advertisement
Game_Logic

Log In

Jan 9th, 2020
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. document.body.innerHTML = "<big>Login to Account!</big><div><input placeholder='Username' id='p1'></input></div><input placeholder='Password' id='p2'></input><div><button onclick='login()'>Log In</button></div><button onclick='signup()'>Sign Up</button><div id='form'></div>"; function signup() { document.getElementById('form').innerHTML = "<input placeholder='Username' id='p1s'></input><input placeholder='Password' id='p2s'></input><button onclick='submitform()'>Sign Up</button>"; }; function submitform() { confirm('Signed Up!'); }; function login() { if(document.getElementById('p1').value == document.getElementById('p1s').value) { if (document.getElementById('p2').value == document.getElementById('p2s').value) { document.body.innerHTML = "<big style='color:red;'>Signed In!</big>"; } else { confirm('Username or Password incorrect.'); }; }; };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement