summaryrefslogtreecommitdiff
path: root/assets/js/core/html.js
blob: f49a629c33d0c1c87f302d12d6ceca16b1cc41db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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));
        }
    }
};