简体   繁体   中英

I can't seem to get my a button to work to submit info on my login screen

I am hoping someone can help me i have been looking for a solution and i can't find one anywhere. when i run the program i fill in all the input boxes and press Log in but nothing happens. at this point i just need to get to the stage where the alert with "pass" works here is my code: `

<head>
    <link rel="stylesheet" href="style.css">
    <title> Login </title>

    <script>     
        var io = 0
        var Name = [""];
        var stayLocation = [""];
        var outOfTown = [""];



        function click(){
            var serch = document.getElementById("id").value; 
            var user = document.getElementById("user");
            var pass = document.getElementById("pass");
            alert(pass)  
        }

    </script>   

</head>

<body>
<h1>Log In</h1>
Id:<input id="id" type="text" name="ID"> <br />
Username:<input id="user" type="text" name="Username">  <br />
Password:<input id="pass" type="text" name="Password"> 
<br /> <br />
<input type="button" name="Log In" value="Log In" onclick=click()>



</body>

`

尝试将函数名称click()更改为其他名称...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM