<div class="form-input">
<input name="username" type="text" placeholder="用户名">
</div>
<div class="form-input">
<input type="text" name="password" placeholder="密码">
</div>
根据name获得值
var username = document.getElementsByName("username")[0].value
var password = document.getElementsByName("password")[0].value