admin管理员组

文章数量:1327928

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.

本文标签: javascript input via native popupStack Overflow