else delete objectWithCheckboxes[el.name]
for(let k in objectWithCheckboxes) res.push(k+'/'+objectWithCheckboxes[k])
<input type="checkbox" class="checkbox" value="1" name="value1">
<input type="checkbox" class="checkbox" value="1" name="value2">
<input type="checkbox" class="checkbox" value="1" name="value3">
<input type="button" value="Apply filter" onClick="location.reload()" />
By clicking on the checkboxes in the address bar of the appropriate variables substituted with the value 1, press the "Apply filter" and everything is OK (php implemented that stretched from the url variables and the selected checkboxes remain checked or better is also on js to make?). BUT!
After reloading the page, clearing a checkbox (form submission), the address is not deleted values, i.e. they start again (which is not necessary): site.ru/value1/1/value2/1/value1/1/value1/1Question:
how to fix the situation, so after refreshing the page (when you already have the address of the type site.ru/value1/1/value2/1 and removing/adding the first and second checkboxes they removed and again added in the address and not re-added?
P. S. can still advise sensible/understandable to the beginner lessons on js, I have long wanted to start learning at least the basics.