window.onscroll = (function(){
var count = 24;
return function() {
var scrollTop=document.documentEle...
...
...
...
}
})();
document.dispatchEvent(new CustomEvent('af_complete;))
но т.к. судя по всему вы не можете изменить исходники modx, то остается использовать только первый вариант addBtn.addEventListener('click', () => {
const newCellName = tableRow.insertCell(0);
const newCellValue = tableRow.insertCell(1);
newCellName.appendChild(document.createTextNode(nameInput.value));
newCellValue.appendChild(document.createTextNode(valueInput.value));
nameInput.value = '';
valueInput.value = '';
});
const formData = new FormData()
const reg = [{'ro': 123, 'ra': null, 're': 0}]
reg.forEach(obj => {
Object.entries(obj).forEach(item => {
formData.append(item[0], item[1])
})
})
document.getElementById("button_one")
у вас нет элемента с id="button_one"document.querySelectorAll('h1')
возвращает группу элементовfunction startQuest() {
var startLink = document.querySelector('.button_one');
startLink.onclick = function() {
var title = document.querySelector('h1');
title.style.display = 'none';
}
}
$(document).on('click', '.btn-color', e => {
$(e.currentTarget)
.addClass('active')
.siblings('.active')
.removeClass('active')
})
var arr = [1,2,3,4,5,6,7,8]
var i = 3
var j = 4
console.log(arr); // [1,2,3,4,5,6,7,8]
[arr[i], arr[j]] = [arr[j++], arr[i--]];
console.log(arr); // [1,2,5,4,5,4,7,8]
// #1
// arr[j++]
// j++ вернет 4
// arr[4] вернет 5
// [arr[i], arr[j]] = [5, arr[i--]]
// #2
// arr[i--]
// i-- вернет 3
// arr[3] вернет 4
// [arr[i], arr[j]] = [5, 4]
// #3
// arr[i]
// i вернет 2
// [arr[2], arr[j]] = [5, 4]
// #4
// arr[j]
// j вернет 5
// [arr[2], arr[5]] = [5, 4]
// #5
// выполняем деструктуризацию
// #5.1
// console.log(arr[2]); // 3
// arr[2] = 5
// console.log(arr[2]); // 5
// #5.2
// console.log(arr[5]); // 6
// arr[5] = 4
// console.log(arr[5]); // 4
// #6
// в результате деструктуризации изменили исходный массив:
// [ 1, 2, 5, 4, 5, 4, 7, 8 ]
document.getElementsByClassName('first')[0].getElementsByTagName('div')[0]
document.querySelector('.first > div')