Home / Javascript Tips Generated By ChatGPT / Creating a Simple Web Page Confirmation in Javascript Use confirm() to ask the user to confirm a choice. Source Code let userResponse = confirm("Do you agree?"); console.log(userResponse); // true if OK is clicked, false if Cancel