我有这段代码,我想在 javascript 中提取用户名和密码以进行某种登录验证。我怎样才能做到这一点?编辑:我正在使用节点 js 服务器来提取一些数据,但这与我想要做的登录页面无关。我正在尝试登录,当用户按下按钮登录时,它会验证密码和用户名是否匹配(登录验证),如果不匹配则进入菜单,则会出现错误。
<div id="login" data-role="page">
<div data-role="panel" id="mypanel" data-theme="a" data-position="left" data-display="reveal">
<ul data-role="listview" data-theme="h">
<li>
<a href="#menu" > Menu</a>
</li>
<li>
<a href="#register" >Register</a>
</li>
<li>
<a href="#cart" > Cart</a>
</li>
<li>
<a href="#account" > Account</a>
</li>
<li>
<a href="#login" > Login</a>
</li>
</ul>
</div><!-- /panel -->
<div data-role="header" data-theme="a" data-position="fixed">
<a href="#mypanel" data-role="button" data-icon="bars" data-iconpos="notext" data-corners="false"></a>
<h1>Log In</h1>
</div>
<div data-role="content">
<!-- username -->
<label for="username">Username</label>
<input id="username" title="Must be at least 8 characters."/>
<br />
<!-- password -->
<label for="password">Password</label>
<input id="password" type="password" title="title it hard to guess." />
<br />
<p>
<button type="button" title="This button won't do anything">
Proceed
</button>
</p>
<label for="register">Don't have an account?</label>
</div>
<div data-role="content">
<a href="#register">Register</a>
</div>
</div>