document.querySelectorAll('.block:not(.red)')
document.querySelectorAll('.block').forEach( item => {
console.log(item.classList.contains('red'))
})
element?.getContext('2d');
element ? element.getContext('2d') : null
if(element && element.getContext) {
//code
}
for await (variable of iterable) {
}
Promise.allSettled()
textareaPaste.innerText = pastedData;//нужно value
<input type="text" id="search">
<button id="send">Проверить</button>
document.querySelector('#send').addEventListener('click', () => {
let value = document.querySelector('#search').value; //значение поля input
//делаем запрос на сервер
})
$(document).ready(function () {
$("#showIB").on("click", function (event) {
event.stopPropagation();
$("#sampleCard")
.animate({
right: 0,
opacity: 1
})
.css("display", "inline");
$('body').css("overflow","hidden");
});
$("#sampleCard").on("click", function (event) {
event.stopPropagation();
});
});
$(document).on("click", function () {
$("#sampleCard").animate(
{
right: "-130%",
opacity: 0
},
{
complete: function () {
$(this).css("display", "none");
}
}
);
$('body').css("overflow","auto");
});
let select = localStorage.getItem(keySelect);
let data = select ? JSON.parse(select) : {};
document.body.append(data['select-1'])
$(window).resize(function(e) {
let width = e.target.innerWidth
if(width < 1200) {
//меняем элементы в html
}
});
var day = document.querySelectorAll(".day");
for(let i = 0; i < day.length; i++) {
console.log( day[i] )
}
[... document.querySelectorAll(".day")].map( item => console.log(item))
const createImage = url => {
let image = document.createElement('img');
image.src = url;
dayimage.appendChild(image);
}
document.querySelectorAll(".day").forEach(item => item.textContent.indexOf('пн') + 1 ? createImage('https://fermeda.ru/iconfood/pnr.png') : createImage('https://fermeda.ru/iconfood/pnn.png'))