JavaScript Base

window.innerWidth
window.innerHeight
window.screen.availWidth
window.screen.availHeigh
window.screen.width
window.screen.height

Code:

elementList = parentNode.querySelectorAll(selectors);

elementList.forEach(function(element) {
    console.log(element)
});

Element Property:

ParentNode.childElementCount

ParentNode.firstElementChild

ParentNode.lastElementChild

ParentNode.children

Element.tagName

Code:

const div = document.createElement('div')
div.className = "big"
div.innerHTML = "Hello World!"
div.style = "color: green;"
console.log(div.outerHTML)
document.body.appendChild(div)

let loop
loop = setInterval(() => {
    div.classList.toggle("big")
}, 1000)

let bt = document.createElement("button")
bt.className = "bt"
bt.innerHTML = "Stop Color Toggle"
document.body.appendChild(bt)

let stopinterval = function() {
    clearInterval(loop);
}
document.querySelector(".bt").addEventListener("click", stopinterval)

JavaScript

这篇文章: 有用 无用
创建 2018-11-13 01:51:58 / 更新 2018-12-03 18:14:02