Like this code
const form = document.querySelector('form'); form.addEventListener('submit', () => { const checkboxes = form.querySelectorAll('input[type="checkbox"]'); const query = [...checkboxes] .filter(checkbox => checkbox.checked) .map(checkbox => checkbox.name) .join('+') const url = 'https://example.ru/search/' + query; // not working in sandbox // window.location.href = url; alert('redirect to ' + url); }) <form> <input type="checkbox" name="Москва"><label>Москва</label> <input type="checkbox" name="Лондон" value="Лондон"><label>Лондон</label> <input type="checkbox" name="Париж" value="Париж"><label>Париж</label> <input type="checkbox" name="Вашингтон" value="Вашингтон"> <label>Вашингтон</label> <button>Подобрать</button> </form> Redo on select option Naturally the question relates to JS