Electron dom for noobs


#1

hi, i am trying to learn how to use electron. i cant seem to detect a variable in one script that points to a text input box. here is the html page :

      <link rel="stylesheet" type="text/css" href="../Scripts/Css/Home.css">
      <script src='../Scripts/Js/Login.js'></script>
<body>
    <form id="Login">
    <input id="LoginBox" placeholder="log in" type="text">
    </form>

      </body>
      </html>

and here is my login.js :

var login = document.querySelector("#LoginBox");
  if (login){
    console.log("true");
  }else{
    console.log("false")
  }

im stuck, because i keep getting false in the console. ive searched around, and i dont want to use an over engineered approach to solving this please.( forgive the preview, i dont know how to use this fancy schmancy formating.)


#2

nevermind, i had a stroke of genius and realized that the login.js script tag should be at the very bottom of the page. wheew… to think i even suspected black magic at work.