Joydip Panchal Javascript Tutorial
How to access element using Class name attribute?
Syntax :
var element = document.getElementByClassName("test"
Here, element is the list of reference to all class which name is "test"....
You can run the for loop to get the value of all class..
Like,
for(i=0;i<element.length;i++)
// code for access element ... element[i]
Syntax :
var element = document.getElementByClassName("test"
Here, element is the list of reference to all class which name is "test"....
You can run the for loop to get the value of all class..
Like,
for(i=0;i<element.length;i++)
// code for access element ... element[i]
Sagar Solanki and Admin like this
Ravi Patel