简体   繁体   English

我似乎无法通过按钮来在登录屏幕上提交信息

[英]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()更改为其他名称...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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