(min-width: 1024px)(max-width: 1023px)<input name="answers[]" value="1" type="checkbox" checked>
<input name="answers[]" value="2" type="checkbox">
<input name="answers[]" value="3" type="checkbox" checked>$_POST['answers']; // [1,3]<input name="answer" value="1" type="radio">
<input name="answer" value="2" type="radio" checked>
<input name="answer" value="3" type="radio">$_POST['answer']; // 2 .menu {
display: none;
}
@media (max-width: 600px) {
.menu.open {
display: block;
}
} const obj = { prop: 123 }
// Это два одинаковых выражения
obj.prop // 123
obj['prop'] // 123const obj = { prop: 123 }
const name = 'prop';
obj[name] // 123const my_func = function() {}
// чтобы ее вызвать
my_func();const obj = {
my_func: function(){}
}const my_other_func = function() {}
const obj = {
my_func: my_other_func
}obj.my_func()obj['my_func']()
// или
const name = 'my_func';
obj[name]() async function getData() {
const o_btc = await fetch('https://api.coingecko.com/api/v3/coins/bitcoin')
.then(res => res.json());
const o_eth = await fetch('https://api.coingecko.com/api/v3/coins/ethereum')
.then(res => res.json());
$('.demo').html(o_btc.market_data.current_price.rub / o_eth.market_data.current_price.rub);
}
getData(); document.querySelectorAll('.button').forEach(button => {
button.addEventListener('click', () => {
button.toggleClass('active');
});
});document.querySelectorAll('.button').forEach(button => {
button.addEventListener('click', event => {
event.target.toggleClass('active');
// Или так, если есть вложенные элементы
// event.target.closest('.button').toggleClass('active');
});
}); const pName = prompt('Введите имя первого человека');
const pAge = prompt('Введите возраст первого человека');
const secName = prompt('Введите имя второго человека');
const secAge = prompt('Введите возраст второго человека');
const person1 = new Person(pName, pAge);
const person2 = new Person(secName, secAge);
const car1 = new Car('sedan', 'petrol','rear brakes','hunday', [person1]);
const car2 = new Car('van', 'diesel', 'rear brakes','nisan', [person1, person2]);
const garag1 = new Garag ('Cindy', '2 Cars', [person1], [car1,car2]);
const garag2 = new Garag ('Jon', '1 Cars', [person2], [car2]);
console.log(garag1,person1,car1,car2); const o = e.target.closest('.blog__item')