http://stilbuero.de Klaus Hartl – Stilbüro - Klaus Hartl


Jump to: Search, Additional Information.


Helpful jQuery/Prototype plugin

Michael Geary has written an helpful jQuery/Prototype plugin that makes creating new DOM nodes much more convenient than using document.create all the time.

If you want to create a new p node with a class attribute named "foo" you just have to write:

var myP = $.P({ Class: "foo" });

Nested nodes anyone?

var myP = $.P({ Class: "foo" }, $.A({ href: "http://www.example.com" }, "My Link"));

By the way, couldn’t agree more: Free beer and free speech. Amen.

Comments are closed.



Klaus Hartl – Stilbüro is powered by WordPress, jQuery, XHTML, CSS and me.