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

Put select element in a javascript prompt? - Stack Overflow

programmeradmin0浏览0评论

I would like to have a javascript prompt pop up that has a selection element in it rather than a text input. When searching for a solution it seems that using jquery could definitely work but I am new to HTML and javascript and the tutorials for a jquery popup are daunting (I cannot figure out how to implement them)! Is it possible to create such a pop up with just javascript? I was hoping something like this would be possible:

prompt(<select>[options...]</select>);

Thanks in advance!

I would like to have a javascript prompt pop up that has a selection element in it rather than a text input. When searching for a solution it seems that using jquery could definitely work but I am new to HTML and javascript and the tutorials for a jquery popup are daunting (I cannot figure out how to implement them)! Is it possible to create such a pop up with just javascript? I was hoping something like this would be possible:

prompt(<select>[options...]</select>);

Thanks in advance!

Share Improve this question asked Jan 23, 2012 at 15:21 ORLORL 6182 gold badges10 silver badges22 bronze badges 1
  • The jQueryUI ones are fairly simple to use; jqueryui.com/demos/dialog/#modal-form (most code in that example is not just applicable to that demo) – Alex K. Commented Jan 23, 2012 at 15:24
Add a comment  | 

2 Answers 2

Reset to default 8

What you're looking for is called a modal dialog. This is really just a DIV with HTML inside it, with an overlay over the rest of the page.

You can roll-your-own or use a ready-made one from a library.

No it's not possible with prompt; If you want such thing you'll have to fake a dialog box in javascript

发布评论

评论列表(0)

  1. 暂无评论