开发者

javascript input via native popup

开发者 https://www.devze.com 2023-01-19 18:08 出处:网络
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 .htpass

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

精彩评论

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