<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div id="alert-dialogue"></div>
<button type="button" class="btn btn-success" id="result-alert">Alert</button>
</div>
$(function(){
$('#result-alert').click(function(result){
var result = 1;//test the output message
var success = '<div class="alert alert-success fade in" role="alert">'
var success = '<div class="alert alert-success fade in" role="alert">'
+ '<a class="close" data-dismiss="alert">×</a>'
+ '<strong><span class="glyphicon glyphicon-ok"></span> Your TechTicket was submitted successfully</strong>'
+ '<div>You will be notified when your ticket has been resolved. Thank you!</div>'
+ '</div></div>';
var fail = '<div class="alert alert-danger fade in" role="alert">'
+ '<a class="close" data-dismiss="alert">×</a>'
+ '<strong><span class="glyphicon glyphicon-remove"></span> Oops! Something went wrong.</strong>'
+ '<div>Please contact Technical Support if the problem persists.</div>'
+ '</div></div>';
if(result == 1){
var output = success;
}
else {
var output = fail;
}
$('#alert-dialogue').append(output);
});
});