前端踩过的坑之<button>按钮(localStorage实现注册实例)
js代码
注册
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>注册</title> </head> <body> <form action="DEMO.html"> <table width="300px" border="1" align="center" cellspacing="" cellpadding=""> <tr> <td>用户名</td> <td><input type="text" id="userN" value="" /></td> </tr> <tr> <td>密码</td> <td><input type="password" id="pwd" value="" /></td> </tr> <tr> <td>手机号</td> <td><input type="text" id="phoneId" value="" /></td> </tr> <tr> <td> </td> <td> <!--此处具有提交的功能:导致saveRegisterData中的location.href不能--> <button>注册</button> <!--<input type="button" onclick="registerF();" value="注册" />--> </td> </tr> </table> </form> </body>

浙公网安备 33010602011771号