function handlerInput(event) {
this.classList.add("input-checked-js");
if (this).classList.contains("input-checked-js") {
убрать значение
} else {
inputHidden.value += this.value;
inputHidden.value += '; ';
}
}
const inputs = document.querySelectorAll('.input-js');
const inputHidden = document.getElementById('additional');
// Обход цикла
inputs.forEach((input) => {
input.addEventListener('click', handlerInput);
});
function handlerInput(event) {
inputHidden.value = this.value;
}
$(document).ready(function(){
$('.more-functions').click(function(){
$('.content').slideToggle('slow');
if( $(this).hasClass('active') )
$(this).html('Все функции <i class="icon icon-arrow_mini-down"></i>');
else
$(this).html('Свернуть <i class="icon icon-arrow_mini-up"></i>');
$(this).toggleClass('active');
});
});
window.addEventListener( 'DOMContentLoaded', function() {
var form = document.getElementById( 'post-date-filter' );
Array.from( document.getElementsByTagName( 'input' ) ).map( function( el ) {
if ( el.type == 'radio' && el.parentNode == form ) {
el.addEventListener( 'change', function() {
form.submit();
} );
}
} );
} );
Так если делать, то при масштабе он не растягивается до картинки, которая справа