Answer the question
In order to leave comments, you need to log in
How to remove the class of only one element from several?
We have:
$('body').on('click', '.js-btnDelete', function() {
$(this).parent().remove();
$('button').removeClass('active');
});
Answer the question
In order to leave comments, you need to log in
At least like this:
function Modal(options) {
this.el = (options && options.el) || document.body;
// init some options (text, width, onClose, onConfirm, etc)
this.init();
}
Modal.prototype.init() {
// build and append modal
}
Modal.prototype.show() {
// show modal and overlay
}
Modal.prototype.close() {
// close modal and overlay
}
var modal = new Modal(options);
var btn = document.querySelector('.btn');
btn.addEventListener('click', function() {
modal.show();
});
Pick up the selector that will select that single button, and remove the class from it)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question