Skip to content

Instantly share code, notes, and snippets.

@staltz
Last active October 14, 2015 18:15
Show Gist options
  • Save staltz/10e4e215cd8aeae1cb1a to your computer and use it in GitHub Desktop.
Save staltz/10e4e215cd8aeae1cb1a to your computer and use it in GitHub Desktop.
h('div.container', [
h('label.nameLabel', 'Name:'),
h('input.myinput', {attributes: {type: 'text'}}),
h('hr'),
h('h1.greeting', `Hello ${name}`)
])
// or
div('.container', [
label('.nameLabel', 'Name:'),
input('.myinput', {attributes: {type: 'text'}}),
hr(),
h1('.greeting', `Hello ${name}`)
])
@hugooliveirad
Copy link

Like hiccup for Clojure, couldn't we just use

html(
  ['div.container', 
    ['label.nameLabel', 'Name:'],
    ['input.myinput', {type: 'text'}],
    ['hr'],
    ['h1.greeting', `Hello ${name}`]
  ]
);

@staltz
Copy link
Author

staltz commented Oct 14, 2015

You can

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment