I want to do a class based on the alert that appear in my application, but what I want is to know how to make a class so that it works with the different id's of each one of the alerts that appear in the application, that is, regardless of the id you have, the class is able to detect them and that works the same for everyone.
<style>
a:hover path {
fill: #d9534f;
}
<center>
<div style="margin: -25px;">
<svg width="120" height="130" margin-top="-3%">
<a href="#" onclick="alertaForm()" id="alertaForm">
<path d="M 0 0 L 150 0 L 120 120 L 60 80 L 0 120 Z" fill="#db2525"/>
<text x="60" y="50"fill="#FFFFFF" text-anchor="middle" alignment-baseline="middle">
Formulario 1 de 7
</text>
</a>
</svg>
</div>
</center>
<div class="" id="formulario0">
</div>
<script type="text/javascript">
function alertaForm() {
document.getElementById("formulario0").innerHTML = '<div class="alert alert-success alert-dismissible" id="alertaPrueba"> <button type="button" id="LinkClose" class="close" data-dismiss="alert">×</button><h2> Formulario <b> 1 de 7 </b><h/h2></div>';
}
$(document).ready(function(){
$('#alertaForm').click(function(){
$('#alertaPrueba').show('fade');
setTimeout(function (){
$('#alertaPrueba').hide('fade');
}, 1000);
});
$('#LinkClose').click(function (){
$('#aleraPrueba').hide('fade');
});
});
</script>
I want to be able to do that with all the alert of my application, but regardless of the id I have detected it.