Alert

The alert function enables you to display an alert on the page, this you can use it to display critical information on the page or use it for page events as well

Structure

alert($message, $type = 'warning')

Parameters

The alert function accepts 2 parameters explained below:

  • Message - the message to be displayed on the alert

  • Type- The type of alert to display. Accepts bootstrap 5 color classes eg: warning, info, success, danger, dark, secondary, light

Example Usage

echo alert('No custom login methods found','info');

Output

Sample output for the alert.

Last updated