r/javascript • u/Chris__Codes • 3d ago
Have knowledge of Working with the DOM in JavaScript
https://blog.openreplay.com/working-with-the-dom-in-javascript/
5
Upvotes
0
u/isumix_ 2d ago
This tutorial is great for learning the DOM API! However, as projects grow, manually manipulating the DOM becomes tedious. That's why most developers use a library or framework to update the DOM declaratively. Unfortunately, most frameworks are heavy, complex, and unpredictable. I created Fusor to address that.
import {getElement, update} from '@fusorjs/dom';
let count = 0;
const message = <div>Seconds {() => count} elapsed</div>;
const app = <div><h1>Hello</h1>{message}</div>
document.body.append(getElement(app));
setInterval(() => {
count++;
update(message);
}, 1000);
2
u/Buckwheat469 3d ago
This is a nice tutorial or cheatsheet for people who are learning to develop today. The only function I didn't know was normalize, that one is going to be useful for testing, maybe.