document.querySelectorAll('#select option').forEach(n =>
if (n.selected == true) {
n.textContent += n.value + '!';
} else {
n.textContent += n.value + '-';
}
)
const select = document.querySelector('здесь селектор вашего select\'а');
const addValToText = option => addText(option, getVal(option));
const getVal = option => option.value;
// или
const getVal = option => option.getAttribute('value');
// или
const getVal = option => option.attributes.value.value;
const addText = (option, text) => option.text += text;
// или
const addText = (option, text) => option.textContent = option.textContent.concat(text);
// или
const addText = (option, text) => option.innerText = `${option.innerText}${text}`;
// или
const addText = (option, text) => option.append(text);
// или
const addText = (option, text) => option.insertAdjacentText('beforeend', text);
// или
const addText = (option, text) => option.appendChild(document.createTextNode(text));
// или
const addText = (option, text) => option.insertBefore(new Text(text), null);
Array.prototype.forEach.call(select, addValToText);
// или
select.querySelectorAll('option').forEach(addValToText);
// или
for (const n of select.options) {
addValToText(n);
}
// или
for (let i = 0; i < select.children.length; i++) {
addValToText(select.children[i]);
}
$size: 36px;
border-radius: calc(#{($size/2) / $size});
$size: 36px;
$result: ($size/2) / $size;
border-radius: calc(#{$result});
$size: 36px;
border-radius: calc((#{$size}/2) / #{$size});
$size: 36px;
border-radius: (($size/2) / $size);
/*Даны два инпута и кнопка. По нажатию на кнопку запишите в первый инпут значение второго инпута, а во второй инпут - значение первого. Ваш код должен работать универсально, для любых значений инпутов.*/
var elem1 = document.querySelector('#elem1');
var elem2 = document.querySelector('#elem2');
var button = document.querySelector('button');
var buff
button.addEventListener('click', function() {
buff = elem1.value;
elem1.value = elem2.value
elem2.value = buff;
})
flex-grow: 1;
$(document).ready(function() {
var stock__clients = $(".owl-carousel");
stock__clients.owlCarousel({
dots: true,
nav: false,
loop: true,
smartSpeed: 2000,
animateOut: 'fadeOut',
navText: '',
items: 1,
});
});
var button = document.querySelectorAll('button');
button.addEventListener('click', function() { ... } )