instead of having a 'container' member, just attach everything to the container and then return it. Now you can say 'element.appendChild( new ColorPicker(128) );'