houdini/client/js/components/radio-and-label-wrapper.js

11 lines
390 B
JavaScript
Raw Normal View History

var h = require("virtual-dom/h")
// a constructor function for creating radio-label pairs
module.exports = function(id, name, customAttributes, content, stream){
var customAttributes = customAttributes ? customAttributes : {}
return [
h('input', {type: 'radio', name: name, id: id, attributes: customAttributes, onclick: stream}),
h('label', {attributes: {'for': id}}, content)
]
}