Get the latest tech news
JavaScript Views, the Hard Way – A Pattern for Writing UI
JavaScript views; done as painfully as possible. Contribute to matthewp/views-the-hard-way development by creating an account on GitHub.
If the component you are working on is likely to be used multiple times in an application (such as a list item) you should probably not use ids, but rather a class name or possibly a data attribute. It contains variables and functions that are used to change state, modify the DOM, listen to events, and receive updates from parent views. One of the difficulties in writing low-level imperative views is keeping track of where DOM mutations can occur.
Or read this on Hacker News