JDOM.js

v3.2.5

Lightweight, Zero-Dependency DOM Builder

Functional approach to creating and manipulating DOM elements with ease

npm install jdom
yarn add jdom

🚀 Simple & Fast

Zero dependencies, lightweight library that focuses on performance and simplicity.

const {DIV, SPAN} = jdom.domFactory; const element = DIV({ className: 'container', children: ['Hello World'] });

🎨 Functional Design

Create elements using a clean, functional API with property-based configuration.

const button = BUTTON({ parent: document.body, children: ['Click me'], click: () => alert('Hello!'), style: { background: 'blue' } });

🖼️ SVG Support

Full SVG element creation with proper namespacing and attribute handling.

const {svg, circle} = jdom.svgFactory; const icon = svg({ children: [circle({ cx: 50, cy: 50, r: 25, fill: 'red' })] });

🔧 jQuery-like Utilities

Built-in selector engine and utility functions for DOM manipulation.

const $ = jdom.$; $('.myClass').style({color: 'red'}); $('#myId').addClass('active');

🎪 Interactive Demo

Click a button above to see JDOM in action!