Is it possible to dynamically add a Bootstrap alert with a fadeIn effect and fadeOut effect on close without using jQuery fadeIn or fadeOut functions?
function alert(title, text, type) {
var html = $("<div class='alert alert-dismissible hide fade " + type + "'><strong>" + title + "</strong> " + text + "<a href='#' class='close float-close' data-dismiss='alert' aria-label='close'>×</a></div>");
$('body').append(html);
html.addClass('in show');
}
$('#EMail').click(function() {
alert('Error!', 'Your Email is not valid', 'alert-danger');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
<input type="text" id="EMail" />
Even though the close functionality works successfully, the append with fadeIn effect is not working. How can I append a Bootstrap alert in the document with a fadeIn effect using standard Bootstrap classes like fade + in or out?
Note that I am specifically looking to achieve this without using jQuery fadeIn or fadeOut functions.