Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Saturday, 10 October 2015

JavaScript Basics

JavaScript Basics

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"; }