Errors in this simple javascript [closed]

  html, javascript

Creating a simple password thing for school.
I think it’s something to do with the squiggly brackets {} but I’m not quite sure

function login() {
  var uname = document.getElementById("username").value
  var pword = document.getElementById("password").value
  //alert(uname+pword)

  if (uname == "Jimbo")
    alert("Ayy Jimbo!")
  document.body.style.backgroundColor = "#B0FC38";
  document.getElementById("myimg").src = "https://i.kym-cdn.com/entries/icons/facebook/000/021/290/bounsa.jpg"

  document.body.style.backgroundColor = "#B0FC38";

  else
    alert("Hey... you're not Jimbo!");
  alert("Oh it's you again...");
  alert("Hey get outta here " + uname + "!");
  document.body.style.backgroundColor = "#DE1738";
}
<h1>Log in</h1>
<p>Please enter your details</p>
<label>Username</label>
<be>
  <input type="text" id="username" /> <br>
  <br>
  <label>Password      </label> <br>
  <input type="password" id="password" />
  <br>
  <br><input type="submit" value="Click here to login" onclick="login()" />

Source: Ask Javascript Questions

LEAVE A COMMENT