print(item.values())const inp = document.querySelector("input");
const buttons = document.querySelectorAll("button");
inp.addEventListener("change", () => {
console.log(inp.value);
});
buttons.forEach((btn, i) => {
if (i === 0) {
btn.addEventListener("click", () => {
inp.value = Number(inp.value) - 1;
});
} else {
btn.addEventListener("click", () => {
inp.value = Number(inp.value) + 1;
});
}
}); var funcName = "sum";
window[funcName] = function () {
console.log(1 + 2);
};
window.sum();var a = "sum";
globalThis[a] = function () {
console.log(1 + 3);
};
sum();var a = "sum";
window[a] = function () {
console.log(1 + 4);
};
sum(); Делал через onclick, но что-то не получается. Вот интересно, что не так?
getData(return false)
function getData(e) {
e.preventDefault();
<тут ваш код>
}onclick="getData(event)" const nodes = document.querySelectorAll('.tab-content')
let sortedNodes = Array.from(nodes).sort((el1, el2) => el1.dataset.tab_content - el2.dataset.tab_content)const container = document.querySelector('.container')
sortedNodes.forEach((el) => {
container.insertAdjacentElement('beforeend', el)
}) function scrollReveal() {
var revealPoint = 150;
var revealElement = document.querySelectorAll(".scrollReveal");
for (var i = 0; i < revealElement.length; i++) {
var windowHeight = window.innerHeight;
var revealTop = revealElement[i].getBoundingClientRect().top;
if (revealTop < windowHeight - revealPoint) {
revealElement[i].classList.add("animated");
}
}
}
window.addEventListener("scroll", scrollReveal);
scrollReveal();function scrollReveal() {
var revealPoint = 150;
var revealElement = document.querySelectorAll(".scrollReveal");
for (var i = 0; i < revealElement.length; i++) {
var windowHeight = window.innerHeight;
var revealTop = revealElement[i].getBoundingClientRect().top;
if (revealTop < windowHeight - revealPoint) {
revealElement[i].classList.add("animated");
window.removeEventListener('scroll', scrollReveal)
}
}
}
window.addEventListener("scroll", scrollReveal);
scrollReveal();include /etc/nginx/conf.d/*.conf;location / {
rewrite ^(/.*)\.html(\?.*)?$ $1$2 permanent;
try_files $uri/index.php $uri.php $uri/index.html $uri.html $uri/ $uri =404;
}