name === null || name === undefined
Смысла от этих строк нетуconst a = 50;
const b = '50';
console.log(typeof a, typeof b);
const list = document.querySelectorAll('.CatalogMenu li a')
list.forEach(item =>{
item.addEventListener('click', (e) =>{
list.forEach(el=>{ el.classList.remove('active'); });
item.classList.add('active')
})
})
export const Media = () => {
const mqList = [
window.matchMedia('(min-width: 0px) and (max-width: 768px)'),
window.matchMedia('(min-width: 768px) and (max-width: 992px)'),
window.matchMedia('(min-width: 992px)'),
];
function mqIf() {
if (mqList[0].matches) {
document.querySelector('body').style.background = 'red';
}
if (mqList[1].matches) {
document.querySelector('body').style.background = 'white';
}
if (mqList[2].matches) {
document.querySelector('body').style.background = 'green';
}
}
mqIf();
for (let i = 0; i < mqList.length; i += 1) {
mqList[i].addEventListener('change', mqIf);
}
};
import media from './file-name.js';
<div>
<video></video>
<video></video>
<video></video>
</div>
<button>серия1</button>
<button>серия2</button>
<button>серия3</button>
let number = 11000000/3;
const input = document.querySelector('input');
const rounded = function(number){
return +number.toFixed(2);
}
let str = rounded(number);
input.value = str.toString().replace(/(^0|[A-Za-zА-Яа-яЁё]|\s)/, '').replace(/(\d)(?=(\d{3})+(\D|$))/g, '$1 ') + `p`;
// 3 666 666.67p
jQuery('.book_btn').on('click'
jQuery('.book_btn2').on('click'
const a = 10;
const b = 2;
const c = 4;
function calc(first, last) {console.log(first + last);}
calc(a, b);
calc(a, c);
let parent = document.querySelector('.parent');
const spans = document.querySelectorAll(`span`);
parent.addEventListener('click', function (e) {
spans.forEach(el => {
console.log(e.target.contains(el));
});
});
const ul = document.querySelector(`ul`);
ul.addEventListener(`click`, (evt) => {
let target = evt.target;
if (target.className === `clk`) {
target.closest(`li`).remove();
}
})