Set an onclick handler for the button and then have it trigger a javascript function - note the use of the alert - just to show the functioning of the function:

function promptMe(){
    var userAdjective = prompt("Please provide an Adjective");
    alert (userAdjective);
}
<button id="bgnBtn" onclick="promptMe()">Start Game</button>

Answer from gavgrif on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › Window › prompt
Window: prompt() method - Web APIs | MDN
window.prompt() instructs the browser to display a dialog with an optional message prompting the user to input some text, and to wait until the user either submits the text or cancels the dialog.
🌐
W3Schools
w3schools.com › js › tryit.asp
W3Schools Tryit Editor - JavaScript Prompt
The W3Schools online code editor allows you to edit code and view the result in your browser
🌐
Quackit
quackit.com › javascript › codes › javascript_prompt.cfm
JavaScript Prompt
The 'prompt' box is created using JavaScript's built-in prompt() function. When the JavaScript prompt() function is triggered, a small box will pop up and display a message to the user (supplied by you), a text field (for the user's input), an "OK" button, and a "Cancel" button.
🌐
W3Schools
w3schools.com › js › js_popup.asp
JavaScript Popup Boxes
JS Examples JS HTML DOM JS HTML Input JS HTML Objects JS HTML Events JS Browser JS Editor JS Exercises JS Quiz JS Website JS Syllabus JS Study Plan JS Interview Prep JS Bootcamp JS Certificate JS Reference · ❮ Previous Next ❯ · JavaScript has three kinds of popup boxes: Alert box · Confirm box · Prompt box ·
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › javascript fundamentals
Interaction: alert, prompt, confirm
<!DOCTYPE html> <html> <body> <script> 'use strict'; let name = prompt("What is your name?", ""); alert(name); </script> </body> </html> ... If you have suggestions what to improve - please submit a GitHub issue or a pull request instead of commenting. If you can't understand something in the article – please elaborate. To insert few words of code, use the <code> tag, for several lines – wrap them in <pre> tag, for more than 10 lines – use a sandbox (plnkr, jsbin, codepen…)
🌐
Javatpoint
javatpoint.com › javascript-prompt-dialog-box
JavaScript prompt() dialog box
JavaScript prompt() dialog box with javascript tutorial, introduction, javascript oops, application of javascript, loop, variable, objects, map, typedarray etc.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript-window-prompt-method
Javascript Window prompt() Method | GeeksforGeeks
September 23, 2024 - The prompt() method in JavaScript displays a dialog box that prompts the user for input.
Find elsewhere
🌐
W3Schools
w3schools.com › jsref › met_win_prompt.asp
Window prompt() Method
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
🌐
O'Reilly
oreilly.com › library › view › javascript-the-definitive › 0596000480 › re346.html
Window.prompt( ) - JavaScript: The Definitive Guide, Fourth Edition [Book]
August 19, 2025 - If the user clicks the OK button, prompt( ) returns the value currently displayed in the input field.
Author   David Flanagan
Published   2001
Pages   936
🌐
SheCodes
shecodes.io › athena › 11102-how-to-trigger-a-prompt-on-button-click-in-javascript
[JavaScript] - How to trigger a prompt on button click in | SheCodes
Learn how to display a prompt when a button is clicked using an event listener with JavaScript. Try this example out for yourself with HTML and web browser. ... Is my JS code correct? Is this how I select all the elements h1, h2, footer and p?
🌐
TutorialsTeacher
tutorialsteacher.com › javascript › display-popup-message-in-javascript
JavaScript Message Boxes: alert(), confirm(), prompt()
November 19, 2001 - The following takes user's confirmation ... } else { userPreference = "Save Cancelled!"; } ... Use the prompt() function to take the user's input to do further actions....
🌐
Altcademy
altcademy.com › blog › how-to-use-prompt-in-javascript
How to use prompt in JavaScript - Altcademy.com
September 17, 2023 - You can think of it as a friendly ... The prompt function pauses the execution of the script until the user responds, which can either be by inputting a value or pressing the cancel button....
🌐
Quora
quora.com › How-do-I-use-javascript-to-open-a-prompt-upon-clicking-an-HTML-element
How to use javascript to open a prompt upon clicking an HTML element - Quora
Answer (1 of 5): There are many types of prompt dialog available , which one you want to use based on your requirement,. Which are following 1. Window prompt() Method : For Getting value from client. 2. Window confirm() Method : For confirm message to client with yes/no button; 3. JavaScript Po...
🌐
The HTML Shark
html-shark.com › JavaScripts › PopupBox.htm
Popup boxes using alert(), confirm() and prompt() | The HTML Shark
May 4, 2023 - Like confirm(), prompt() needs a script for doing something with what you enter. For the example being shown here, we need a field to write in, but what you enter may as well be an access code or search term for a database search, so a field like the one in the example isn't a requirement. The first thing we make is the button that execute the script promptFunction().
🌐
Stack Overflow
stackoverflow.com › questions › 39298732 › custom-prompt-box-using-javascript-and-css
Custom prompt box using javascript and CSS - Stack Overflow
August 9, 2025 - I am working on a custom prompt box. So far I used a hidden div that is shown on a button click with javascript: function openPromptBox() { var pos = FindXY(document.promptForm); var cont = $('
🌐
Scaler
scaler.com › home › topics › javascript window.prompt() method
JavaScript Window.prompt() Method - Scaler Topics
August 28, 2023 - window.prompt() method in JavaScript is used to display a dialog box that prompts the user to do some activity like entering a value, or pressing the "OK", or "Cancel" button.