Search code examples
javascriptprompt

Hide/Change javascript prompt title


I am using the following code to show a prompt to get the user's name:

var name = prompt('Enter your name', 'name');

The problem is that the prompt is showing the title as index.html which is the name of the html file that invokes the prompt. Either I need to change the title or I need to remove the title entirely since showing the file name as header is totally weird. What can I do about it?

EDIT

My index.html has a title tag that looks like following:

<title>My Page</title>

Solution

  • For security reasons this is impossible. You can use some custom prompt other than the basic one like $.dialog of jQueryUI