I am trying to create buttons by using jQuery's append
method. However the buttons which where created by jQuery don't have the wave effect if I click on them. The button that I created in HTML has the wave effect.
Why is it different? How can I get the wave effect to also appear for the button which is created by jQuery?
Thanks for your help!
$('#line').append('<button type="button" class="btn btn-lg btn-primary">Button created by js</button>');
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.7.5/css/mdb.min.css" rel="stylesheet"/>
<button id="btn1" type="button" class="btn btn-lg btn-primary">
Button
</button>
<hr id="line">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.7.5/js/mdb.min.js"></script>