Please be patient throughout this, I am VERY bad at coding both JavaScript and HTML, and this problem is probably trivial to anyone who knows anything.
For a school project, I have to create a website with a JavaScript, interactive feature. I'm planning on making a button that subsequently, when pressed, prompts the user many questions, such as "Do you have an account?", "Username?", and "Password". I believe my JavaScript is written correctly, but when I link it in my HTML, and when I press the button that is intended to start this prompting, nothing happens. What am I doing wrong?
Here are segments of both my HTML and JavaScript code that I am using.
JavaScript
function LogIn(){
var Account = prompt("Do you have an account?")
if (Account = "yes"){
var Username = prompt("Username");
if (Username = "MarkColley"){
var Password = prompt("Password");
...
else{
confirm("That keyword is not acceptable. Try 'yes' or 'no' instead.");
}
document.getElementById("demo").innerHTML = text;
}
HTML
<li><a href="CurrentShows.html">Current Shows</a></li>
<li><img src="https://cdn4.iconfinder.com/data/icons/man-and-woman/154/man-human-person-login-512.png" style="width:20px;height:20px;"><button onclick="Login()">Sign Up/Log In</button></a></li>
<script type="text/javascript" src="LogInSignUp.js"></script>
</ul>
If it helps at all, here is an image of what the button/area that I am trying to get to work looks like.
=and==/===is covered really early on.</a>that has no<a>, and be careful usingbutton: If you put it in a form, the default value oftypeforbuttonissubmit(e.g., if you put it in a form and don't saytype="button", it will submit the form).