diff options
Diffstat (limited to 'assets/js/core/html.js')
-rw-r--r-- | assets/js/core/html.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/assets/js/core/html.js b/assets/js/core/html.js new file mode 100644 index 00000000..f49a629c --- /dev/null +++ b/assets/js/core/html.js @@ -0,0 +1,25 @@ +KB.html.label = function (label, id) { + return KB.dom('label').attr('for', id).text(label).build(); +}; + +KB.html.radio = function (label, name, value) { + return KB.dom('label') + .add(KB.dom('input') + .attr('type', 'radio') + .attr('name', name) + .attr('value', value) + .build() + ) + .text(label) + .build(); +}; + +KB.html.radios = function (items) { + var html = KB.dom('div'); + + for (var item in items) { + if (items.hasOwnProperty(item)) { + html.add(KB.html.radio(item.label, item.name, item.value)); + } + } +}; |