I am currently learning javascript and I found some difficulties in understanding the difference between class and className.
I am wondering if there are any difference between class and className. As when I am learning Javascript, I found that I may use either of it to retrieve the class name of specific node: e.g.
var firstChildClass = firstChildName.className;
var firstChildClass2 = firstChildName.getAttribute('class')
A more detailed script can be found on http://jsfiddle.net/hphchan/3ze3ug7r/.
I would like to ask in implementation, are there any subtle differences between the two?
Btw I have been visited object.className or object.getAttribute("className/class")?, and understand that using getAttribute('class') is more universal than className since className works only on HTML, not others like SVG. But are any extra difference exist between the two?
Thanks.