123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <!DOCTYPE html>
- <html>
- <meta charset="utf-8" />
- <script src="assets/js/jquery-3.1.0.js"></script>
- <body>
- <button onclick="myFunction()">试一试</button>
- <script>
- function myFunction() {
-
- prompt("是否确认更改为营业中状态?<br>确认请输入手机号提交","sdfs",commitButton,closefun);
- }
- function commitButton() {
- alert(1)
- }
- function closefun() {
-
- document.getElementById("alertDiv").remove();
- }
- function prompt(text2,input,fun1,fun2) {
- $("body").prepend('<div id="alertDiv" style="font-size:30px;width: 100%;height: 100%;position :absolute ;background: rgba(0,0,0,0.5);display: none;"> ' +
- ' <div style="border-radius:25px;width: 500px;height: 350px; top: 0; left: 0; right: 0; bottom: 0; margin:500px auto 0 auto ;' +
- 'background: white;text-align: center;padding: 20px;"> <label style="font-size:40px;">系统提示</label> ' +
- ' <div style="margin-top:10px;"> <label id="syyText2">是否提供手机号</label><br></div> <input id="syyInput" style="font-size:30px;border: 1px solid #ccc;width: 100%;height:15%;margin-top: 5%;"><br><br> ' +
- ' <table width="100%" style="height:90px;border-top: 1px solid #a0f7dd;"> ' +
- ' <tr><td style="border-right: 1px solid #a0f7dd;"><b style="color: blue" id="syyCommit">提交</b></td> ' +
- ' <td><b style="color: blue" id="colsefunid">关闭</b></td> </tr> </table> </div> </div>');
-
- document.getElementById("alertDiv").style.display = "";
- // document.getElementById("syyText1").innerHTML=text1
- document.getElementById("syyText2").innerHTML=text2
- document.getElementById("syyInput").value=input;
- document.getElementById("syyCommit").onclick=fun1
- document.getElementById("colsefunid").onclick=fun2
- }
- </script>
- </body>
- </html>
|