sohappyoh 发表于 2015-10-12 15:48:10

请教:会Jquery-mobile,CheckBox怎么动态添加很多条目?

本帖最后由 sohappyoh 于 2015-10-12 16:30 编辑

请教:会Jquery-mobile,CheckBox怎么动态添加很多条目?主要是命名规则是什么,目前试了多次都有问题? a, b, c是干嘛的
是我搞错了,abc好像没意义,OK了


                        <form>
                                <fieldset data-role="controlgroup" data-type="horizontal">
                                        <legend>Horizontal:</legend>
                                        <input type="checkbox" name="checkbox-h-2a" id="checkbox-h-2a">
                                        <label for="checkbox-h-2a">One</label>
                                        <input type="checkbox" name="checkbox-h-2b" id="checkbox-h-2b">
                                        <label for="checkbox-h-2b">Two</label>
                                        <input type="checkbox" name="checkbox-h-2c" id="checkbox-h-2c">
                                        <label for="checkbox-h-2c">Three</label>
                                </fieldset>
                        </form>

armstrong 发表于 2015-10-12 16:23:00

直接用DOM接口吧,createElement,createTextNode,setAttributes,等等。

sohappyoh 发表于 2015-10-12 16:27:51

armstrong 发表于 2015-10-12 16:23
直接用DOM接口吧,createElement,createTextNode,setAttributes,等等。

这个知道
页: [1]
查看完整版本: 请教:会Jquery-mobile,CheckBox怎么动态添加很多条目?