I have this element:
<div class="btn-group"></div>
And I have an click event in jquery and I have selected above div and now after selecting the element I want to add two classes named dropdown and open to its btn-group class.
It means I want to have this:
<div class="btn-group dropdown open"></div>
If the element already contains the btn-group class.
How can I do that?
Try
$('.btn-group').addClass('dropdown open')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With