Most Powerful Open Source ERP

Guideline JavaScript Class Name And Id Attribute Are Lowercase With Underscore Separator

General coding convention.
  • Last Update:2017-05-09
  • Version:001
  • Language:en

Class And Id Attributes Are Lowercase With Underscore Separator

JavaScript can access elements by their ID attribute and class names. When assigning IDs and class names with multiple words, these should also be separated by an underscore (same as variables).

Good Example:

element.setAttribute("class", "my_class");
or
<div class="my_class" />

Bad Example:

element.setAttribute("class", "myClass");
or
<div class="myClass" />