background preloader

Todo

Facebook Twitter

Articles | alternatives to innerHTML. Version 1.0 Last Revision: 02.10.2006 steve@slayeroffice.comslayeroffice.com Introduction The focus of this article will be to show you ways of doing things commonly reserved for innerHTML with only DOM methods. In each example, the innerHTML method will be shown, followed by its DOM based alternative. What's wrong with innerHTML? A few things: It's not a standard. Ok...anything good about it? Sure. It's faster than DOM methods. It was when my favelets stopped working for people when they were invoked on application/xhtml+xml sites that I decided to wash my hands of it (and do a lot of re-coding). Example One [1a] Creating an element. This example introduces three DOM methods. The second is the setAttribute method. The last is the appendChild method.

InnerHTML document.getElementById("mContainer").innerHTML = "<div id=\"myDiv\"></div>"; [1b] Creating an Element with Text In this example you'll use the createTextNode method of the document object. In this example, you'll create two elements. Remember The Milk. Learn More. JotSpot Live. My Tickler File. PocketMod: The Free Disposable Personal Organizer. Voo2do : simple, beautiful web-based to-do lists. WorkHappy.net: killer resources for entrepreneurs. Personal information management, to do lists, organizer: Backpack. Current Backpack customers can sign in here. Hello, We launched Backpack back in 2005 so people could “keep life’s loose ends together” in one place online. Since then, hundreds of thousands of people have kept millions of loose ends safe in their online Backpacks.

However, because we haven’t given Backpack much attention in the last few years, and as part of refocusing our efforts on a slimmer product line, we’ve decided to no longer offer Backpack to new customers. Existing customers will be able to continue using Backpack as they always have. For those new customers who are interested in something like Backpack, we highly recommend checking out Basecamp.

Onwards, Jason Fried, Founder & CEO, Basecamp.