Selector
- ID selector
var example = documnet.getElementById("example");
- Class selector
var example = document.getElementsByClassName("example");example[0].style.display = "none";
//You have to specify the order inside []
//If you want to select all the class
for (var a = 0; a<example.length; a++){ example[a].style.display = "none"; }
//You have to specify the order inside []
//If you want to select all the class
for (var a = 0; a<example.length; a++){ example[a].style.display = "none"; }
No comments:
Post a Comment