最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript input via native popup - Stack Overflow

programmeradmin1浏览0评论

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

These forms are much like the primitive 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)

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

These forms are much like the primitive 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)

Share Improve this question asked Oct 13, 2010 at 20:38 mačekmaček 77.8k37 gold badges170 silver badges200 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 10

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)

  1. 暂无评论