lightbulb_outline#Manipulating DOM

prompt( ); //for input

var sth = document.getElementById("some-id");
sth.innerHTML = "the text hijacker";
//manipulating HTML

//from here, all stuff that says selectedDOM === sth //YKWIM

jQuery("") or $("")
.hide().show("slow");
//jQuery, refresh the page n look at the last sentence!

selectedDOM.className = "replacedAllClassesWithThis"
//well, that's obvious

selectedDOM.classList.add("newclassy");
//add a class, see first sentence's class 'lagi'

replace this

replace this

replace this again

replace this again

replace this

this 'h4' appears slowly, animated by using jQuery

how the 'Magnificent' below works

//tambah anak
var anakbaru = document.createElement("div");
anakbaru.innerHTML = "Magnificent!";
//styling anakbaru
anakbaru.style.backgroundColor = "orangered";
anakbaru.style.color = "white";
anakbaru.style.fontSize = "1.4em";
anakbaru.style.padding = "20px";
anakbaru.style.textAlign = "center";
anakbaru.style.height = "100px";
//adding class to anakbaru
anakbaru.classList.add("lagi");
//append child anakbaru
document.body.appendChild(anakbaru);