There are two lists, a drop-down list and a list of items with checkboxes. It is necessary that when selecting elements from the second, the corresponding elements were selected in the first. Moreover, if after loading the page in the first one the elements have already been selected, then in the second they should also be with checkboxes.
I know that the main thing that is needed is .change(function() but in an hour nothing good came to mind.
How to tie until I can not imagine ..
$('.form-type-checkbox').change(function() { }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> <select multiple="multiple" name="field_akctest_tid[]" id="edit-field-akctest-tid" size="3" class="form-select valid"> <option value="821">Акции</option> <option value="822">Мероприятия</option> <option value="823">Розыгрыши</option> </select> <div class="form-type-checkbox"> <label class="option"> <input type="checkbox" value="821" class="form-checkbox">Акция</label> <label class="option"> <input type="checkbox" value="822" class="form-checkbox">Мероприятие</label> <label class="option "> <input type="checkbox" value="823" сlass="form-checkbox">Розыгрыш</label> </div>