Message box with a title

Here is how to show a message box with a title.

Source Code

Here is source code.

function myFunction() {
  Browser.msgBox("First Message", "Hello, Google!", Browser.Buttons.OK_CANCEL);
}

Here is refactored source code.

function myFunction() {
  var title = "First Message";
  var msg = "Hello, Google!";
  Browser.msgBox(title, msg, Browser.Buttons.OK_CANCEL);
}

Format

Browser.msgBox(title, text, buttons)

Parameters

(1) title

You have to edit a title to be shown on a message box.

(2) text

You have to edit text to be shown on a message box.

(3) buttons

You have to edit a type of buttons to be shown. Here is all parameters for “buttons”

Parameters of buttons are written in the following post;

How to create a message box with buttons?

Note

It is unable to use in Google Sites.

1 thought on “Message box with a title”

Leave a Comment