开发者

javascript input via native popup

In the past, I've seen javascript alert() style popups but they had input fields in them.

These forms are much like the pr开发者_如何学Cimitive username/password field inputs you see when an .htpasswd file is used.

Can someone tell me how to implement this using regular javascript? (No libraries please)


Yes, you're thinking of prompt. It's just:

var userInput = prompt("text to display", "default input text");

Note that this is just a general input mechanism. It's separate from the authentication dialog, though the underlying browser code may use the same GUI controls.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜