Skip to content

Instantly share code, notes, and snippets.

@staltz
Last active Oct 14, 2015
Embed
What would you like to do?
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

hugooliveirad commented Oct 14, 2015

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