<div class="mui-button">
<button id="code" type="button" >忘记密码</button>
</div>
$(function(){
$('#code').on('click',function(){
$(location).attr('href','index.php/index/code/index');
})
})
按钮如果不设置type类型,则默认type类型为submit 提交
在html属性中必须加上type类型 type=“button” ,才能正常跳转页面