I am trying to make a dropdown selection with jquery over bootstrap, for me this seems to be hard to be done. This is my code:
<div id="green" class="X dropdown mt-4 pb-3">
<button id="btn" type="button" class="btn btn-default dropdown-toggle " data-toggle="dropdown">Select
languange</button>
<button class="dropdown-menu">
<a id="1" class="dropdown-item" href="#">English</a>
<a id="2" class="dropdown-item" href="#">German</a>
<a id="3" class="dropdown-item" href="#">French</a>
</button>
</div>
$('.classdropdwn').click(function(){$('.classbutton').html( $(this).text)})
also I have tried sometrhing like this:
$(document).ready(function(){
$('#btn').click(function(){
$("#btn").empty()
$("#btn").html( $(this).text)
});
});
Thank you for your help!