如何把填写的手机号点击“保存”提交到我页面的手机号
- 发布:2016-11-14 15:34
- 更新:2016-11-14 17:08
- 阅读:990
mui setting 页面上传递值
乙亥 (作者)
继续问,我这儿的保存按钮,为何没法触发事件```javascript
<div id="mobile" class="mui-page">
<div class="mui-navbar-inner mui-bar mui-bar-nav">
<button type="button" class="mui-left mui-action-back mui-btn mui-btn-link mui-btn-nav mui-pull-left">
<span class="mui-icon mui-icon-left-nav"></span>更改手机号
</button>
<button id="save" onclick="javascript:getsj();" type="submit" class="mui-action-back mui-btn mui-btn-success mui-pull-right" >
保存
</button>
</div>
<div class="mui-input-row">
<input id="sjnum" type="text" style="margin-top: 15px" placeholder="手机号可以让你的朋友更方便联系你">
</div>
</div>
function getsj(){
var input = document.getElementById('sjnum');
var value = input.value;
var span = document.getElementById('shouji');
if(span.length > 1){
for(i=0;i<span.length;i++){
span[i].innerHTML = value;
}
}else{
span[0].innerHTML = value;
}
}