Skip to content

Instantly share code, notes, and snippets.

@staltz

staltz/divs.js

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}`)
])
@hugobdev

This comment has been minimized.

Copy link

@hugobdev hugobdev 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

This comment has been minimized.

Copy link
Owner Author

@staltz 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