You look like you are trying to use Bootstrap's 'alert' classes (e.g. 'success'). http://getbootstrap.com/components/#alerts

The only way to make that a semantic element like <alert /> that I know of is something like AngularJS: http://angular-ui.github.io/bootstrap/#/alert

In this case, it is all styled by Bootstrap, or whatever Bootstrap theme you are using.

Answer from Burstaholic on Stack Overflow
🌐
W3Schools
w3schools.com › howto › howto_js_alert.asp
How To Create an Alert Message Box
Alert messages can be used to notify the user about something special: danger, success, information or warning.
🌐
W3Schools
w3schools.com › jsref › met_win_alert.asp
Window alert() Method
The alert() method displays an alert box with a message and an OK button. The alert() method is used when you want information to come through to the user.
🌐
GeeksforGeeks
geeksforgeeks.org › html › html-dom-window-alert-method
HTML DOM Window alert() Method - GeeksforGeeks
The alert() method in HTML and JavaScript is used to display an alert box with a specified message.
Published   July 11, 2025
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › Window › alert
Window: alert() method - Web APIs | MDN - Mozilla
window.alert() instructs the browser to display a dialog with an optional message, and to wait until the user dismisses the dialog.
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › javascript fundamentals
Interaction: alert, prompt, confirm
There are other ways to show nicer windows and richer interaction with the visitor, but if “bells and whistles” do not matter much, these methods work just fine. ... Create a web-page that asks for a name and outputs it. ... <!DOCTYPE html> <html> <body> <script> 'use strict'; let name = prompt("What is your name?", ""); alert(name); </script> </body> </html>
Find elsewhere
🌐
W3C
w3.org › WAI › ARIA › apg › patterns › alert › examples › alert
Alert Example | APG | WAI | W3C
August 12, 2025 - Testing code based on this example ... use in production systems. The ARIA and Assistive Technologies Project is developing measurements of assistive technology support for APG examples. Robust accessibility can be further optimized by choosing implementation patterns that maximize use of semantic HTML and heeding the warning that No ARIA is better than Bad ARIA. The below example demonstrates the Alert Pattern. Activating the Trigger Alert button causes a message to be inserted ...
🌐
TutorialsPoint
tutorialspoint.com › how-to-create-alert-messages-with-css
How to create alert messages with CSS?
To create alert messages with CSS, the code is as follows − · <!DOCTYPE html> <html> <head> <style> body{ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } .alertMessage { padding: 20px; background-color: #f44336; color: white; font-size: 20px; } .close{ margin-left: 15px; color: white; font-weight: bold; float: right; font-size: 22px; line-height: 20px; cursor: pointer; transition: 0.3s; } .close:hover { color: black; } </style> </head> <body> <h1>Alert Message Example</h1> <div class="alertMessage"> <span class="close" onclick="this.parentElement.style.display='none';">×</span> <strong>This cannot be revered!</strong> Your account will be deleted.
🌐
Bootstrap
getbootstrap.com › docs › 4.0 › components › alerts
Alerts · Bootstrap
Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages. Alerts are available for any length of text, as well as an optional dismiss button. For proper styling, use one of the eight required contextual classes (e.g., .alert-success). For inline dismissal, use the alerts jQuery plugin.
🌐
University of Washington
washington.edu › accesscomputing › webd2 › student › unit5 › module2 › lesson1.html
Lesson 1: Using JavaScript to Show an Alert
Then test it to be sure it works. So far in this lesson, we have called the showAlert() function when the body of the web page is loaded. However, we could trigger it using other events instead. For example, we might to display the alert only if a user clicks on a button.
🌐
SitePoint
sitepoint.com › javascript
Html tags in alert box? - JavaScript
January 16, 2006 - Hi all, I am running into problems with JS again :sick: The situation now is that I have a set of assesment quiz questions for my users and once they click ‘submit’, there will be a message box showing the results. Among wrong answers, I will want to include a link back to the relevant ...
🌐
W3Schools
w3schools.com › js › tryit.asp
W3Schools Tryit Editor - JavaScript Alert
The W3Schools online code editor allows you to edit code and view the result in your browser
🌐
Javatpoint
javatpoint.com › javascript-alert
JavaScript alert() - javatpoint
JavaScript alert() with javascript tutorial, introduction, javascript oops, application of javascript, loop, variable, objects, map, typedarray etc.
🌐
Codecademy
codecademy.com › forum_questions › 512d28a06918338f2300e9ea
How to make a html button clickable and to show alert on it ? | Codecademy
<script> function clickAlert() { alert("Alert!"); } </script> <input type="button" onclick="clickAlert()" value="Click-2-Alert">
🌐
Stack Overflow
stackoverflow.com › questions › 66790588 › alert-message-on-button-submit-javascript
html - alert message on button submit javascript - Stack Overflow
Having said that: the reason why you don't want alert, is because it's an ancient function. It does not return a promise, and cannot be then'd. It's a thread-blocking call, so any code that should happen after the user clicks "OK" would just be on the next line. Still: don't use alert/confirm/prompt, use a modern modal/dialog instead.
🌐
W3Schools
w3schools.com › bootstrap › bootstrap_alerts.asp
Bootstrap Alerts
For a list of all HTML Entities, visit our HTML Entities Reference. × Click on the "x" symbol to the right to close me. I will "fade" out. The .fade and .in classes adds a fading effect when closing the alert message:
🌐
Uw
projects.accesscomputing.uw.edu › webd2 › student › unit5 › module2 › lesson1.html
Lesson 5.2.1: Using JavaScript to Show an Alert
Then test it to be sure it works. So far in this lesson, we have called the showAlert() function when the body of the web page is loaded. However, we could trigger it using other events instead. For example, we might to display the alert only if a user clicks on a button.
🌐
Quackit
quackit.com › javascript › javascript_alert_box.cfm
JavaScript Alert Box
The JavaScript alert box is useful for alerting your users to something important. When a JavaScript alert box is triggered, a small box will pop up and display the text that you specify in your JavaScript code. You create a JavaScript alert box by calling the built-in JavaScript alert() function. ...