[Javascript] someJavascript (DOM)
#script src="myscript.js"##/script#
--- Before closing body tag
const itemA = document.createElement("b")
itemA.innerText = "Have a great day"
document.getElementById("halo").appendChild(itemA)
itemA.setAttribute("style","color:Red")
a = window.alert("Have a good time");
b = window.confirm("Yes or No");
window.alert(b);
c = window.prompt("How are you today?");
window.alert(c);
Google yourself. hehe
const count = (function () {
let num = 10;
return function () {
return num--;
};
})();
function countDown() {
const info = document.getElementById("info");
let timerId = null;
let num = count();
if (num > 0) {
info.innerHTML += "" + num + "/";
timerId = window.setTimeout(countDown, 1000);
} else {
info.innerHTML += "Time's up";
window.clearTimeout(timerId);
}
}
countDown();
*Only applies to web server nia. This is good
Google yourself. hehe
Source: ---
Disclaimer: The information in this webpage is shared by anonymous users from external online sources. We cannot guarantee its accuracy or truthfulness. Users should exercise caution and verify information independently.