有什么方法可以创建带有两个输入字段的提示? [英] Is there any way to create prompt with two input fields?
本文介绍了有什么方法可以创建带有两个输入字段的提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法用两个输入字段在JavaScript中创建提示?
Is there any way to create prompt in JavaScript with two input fields ?
我尝试了该代码,但对我没有帮助:
I tried that code, but it didn't help me :
var a = prompt("A : ", "");
var b = prompt("B : ", "");
alert(a + "\n" + b);
推荐答案
当操作系统或本机浏览器窗口弹出时,这是不可能的.您将必须创建一个自定义覆盖对话框.
This is not possible with an OS or native browser window popping up. You will have to create a custom overlay dialog.
我建议使用类似 jQuery UI 之类的库来执行此操作.然后,您可以自定义弹出窗口中的任何内容.
I would advise using a library like jQuery UI to do this. You can then customize whatever is in the popup.
您可以在此对话框中查看演示
这篇关于有什么方法可以创建带有两个输入字段的提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文