Java Reference
In-Depth Information
<< "swimming"
If an element does not have an attribute, the setAttribute method can be used to add
it to the element. For example, we can add an id of "run" to the run paragraph:
<< undefined
<< "run"
Note: Legacy DOM Attributes
The legacy DOM allows access to attributes using dot notation, like so:;
<< "bike"
This notation is still supported, although some attribute names such as
class and for are reserved keywords in JavaScript so we need to use
className and htmlFor instead:
<< "swim"
Search WWH ::

Custom Search