Menu

New Elements

James Stortz

Creating New Elements On The Document/Element(s)

dynamic element appending

New Elements

| OVERVIEW

Creating/Appending Elements should be simple and universal, on.js makes everything possible in one easy step.

ON DOCUMENT

Elements

('new div')[on](document)('the-className', 'the-id');


:::javascript

('new span')[on](document)('the-className', 'the-id');


:::javascript

('new etc')[on](document)('the-className', 'the-id');

Images

('new img')[on](document)('../the-source.jpg');

I-Frames

('new iframe')[on](document)('../the-source.html', 'the-name', width, height);

CSS

('new css')[on](document)('../the-source.css');


:::javascript

('new link')[on](document)('../the-source.css');

Scripts

('new script')[on](document)('../the-source.js');

ON ELEMENT

Elements

('new div')[on](theElement)('the-className','the-id');


:::javascript

('new span')[on](theElement)('the-className','the-id');


:::javascript

('new etc')[on](theElement)('the-className','the-id');

Images

('new img')[on](theElement)('../the-source.jpg');

I-Frames

('new iframe')[on](theElement)('../the-source.html', 'the-name', width, height);

on.js

return true;

A JavaScript Library


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.