Dialog box in java script appears as separate window and their content depends on the information provided by user. Java script provide the Alert dialog box that can be used to display the string message or display some information.
suppose user input some wrong information to the input box then we can use Alert dialog box for showing error message.
we can use Alert dialog box as :
the java script alert() method takes a string as an argument and displays an alert dialog box in the browser window when invoked by appropriate java script.