You can select one or more elements, as described in the following section, and then use a range of techniques to manipulate the elements.
Using metadata in this way is discussed in "Using Data- Attributes" later in this chapter.
You may not be accustomed to thinking of these technologies as development languages.
However, considering them in this way can help to clarify the role that each one plays in your application, and can help you keep their responsibilities separate.
There are several ways that Java Script code can add interactivity to a page through manipulation of the HTML structure and content without requiring a full-page reload.
Some typical approaches are: Using a Java Script Library to Manipulate the DOM For a rich user experience, where your application can change the UI while avoiding full page reloads, it is obviously necessary to have a mechanism for manipulating the DOM. However, due to different DOM and Java Script implementations within different browsers, using a Java Script library to shield you from cross-browser compatibility issues is the only practical approach for anything more than very simple interactions.
In fact, this approach was commonly used in the past to identify elements in order to attach some behavior.