Builder in action

Click on the buttons for each scripting code to see the results.

Code example Result
// Text child
Builder.node('h1', 'Builder rules')
// Element child
Builder.node('h1', Builder.node('code', 'Builder'))
// Multiple children
Builder.node('h1', [ Builder.node('code', 'Builder'), ' rules'])
// Attributes, text child
Builder.node('a', { href: 'http://prototypejs.org' }, 'Prototype!')
// Attributes, element child
Builder.node('p', { className: 'submission' },
  Builder.node('input', { type: 'submit', value: 'Sign in' }))
// Attributes, multiple children
Builder.node('a',
  { href: 'http://prototypejs.org/api/ajax/updater' },
  [ Builder.node('code', 'Ajax.Updater'), ' documentation' ])