We must use a function to do opations, Functions are expressions that often get some input data and doing some operations on them and returning a value as a result, or do an operation and the result is visual changes in the page instead. A function for making a message box is in the second group. Look at its code then we’ll discuss more about it:
When you run this page (just when it loads), a message box will be shown:
Description: Message Box
‘alert’ is a function that shows box with text we passed as the argument. To insert input data to the functions, you must open a parenthesis. If you have a text as an input (like a message for a message box), it must be written between single our double quotes (‘text’ or “text”).