简体   繁体   English

如何从提示框中删除标题

[英]How to get rid of title from a prompt box

I have the following code : 我有以下代码:

var answer = prompt('ENTER YOUR TEXT);

When javascript executes it puts up the prompt box but gives it a title on top of the box of the html file that this code is part of. 当javascript执行时,它会出现提示框,但会在此代码所在的html文件的框顶部为其提供标题。

Any way to get rid of that? 有什么办法摆脱呢?

No, this isn't possible. 不,这是不可能的。 Try something like apprise instead 尝试像apprise这样的东西

Apprise('Name:', {input:true});

http://labs.bigroomstudios.com/libraries/Apprise-v2 http://labs.bigroomstudios.com/libraries/Apprise-v2

Edit below 在下面编辑

This solves the issue in a neat way! 这样可以很好地解决问题!

window.prompt = function(text, callback) {

    var options = {
        buttons: {
            confirm: {
                text: 'Send',
                action: function(e) {
                    callback(e.input);
                    Apprise('close');
                }
            },
        },
        input: true
    };

    Apprise(text, options);
};

prompt("Say something", function(returnValue) {
    console.log(returnValue);
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM