I work in stages, and I am so grateful that I have already received a lot of help from others. I still do not ask though!
My steps are divided into different ones <section>, and I would like to give <section>a class="multiple"that this particular section has several options. I use .selectedto determine if a value is selected <li>or not.
This is my current code:
$('li').on('click', function(e) {
e.preventDefault();
$(this).closest('section').nextAll('section').find('li').removeClass('selected');
$(this).siblings('li').removeClass('selected').end().toggleClass('selected');
var $target = $('#' + $(this).attr('data-id'));
if ($target.length) {
$(this).closest('section').nextAll('section').find('.step').not($target).removeClass('active');
$target.toggleClass('active', $(this).hasClass('selected'));
} else {
console.log('do something else to end this thing');
}
})
So my question is: what can I do with my code to make <section class="multiple>it possible for multiple selected elements?
This is my JSFiddle . Click on the items to get the last step, which should be a section that allows several choices.
Thanks for the help.