当前位置:编程学习 > JS >>

js 中confirm提示框的按钮确定和取消变为是和否

答案:下面这个方法可以将按钮替换为“是”,“否”的形式,只支持IE <script language=javascript> function window.confirm(str) { execScript("n = (msgbox('"+str+"',vbYesNo, '提示')=vbYes)", "vbscript"); return(n); } alert(confirm("重载的confirm弹出框")); </script>
其他:There is no way to change the labels that appear in the buttons of the dialog box (to make them read Yes and No, for example). Therefore, you should take care to phrase your question or message so that OK and Cancel are suitable responses. 

上一个:js获取上传图片的尺寸
下一个:js能否自定义事件?如:<input type='text' ontextchange='vali();' />

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,