表单将元素附加到现有表单

时间:2014-01-23 10:13:52

标签: jquery

我创建了这个dform(http://daffl.github.io/jquery.dform/

<head>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/daffl/jquery.dform/master/dist/jquery.dform-1.1.0.js"></script>
</head>
<body>
<form id="container"></form>
</body>
<script>
jQuery("#container").dform({
    "type":"ul",
    "name":"ulxx",
    "id":"ulxx",
    "html":[
        {
            "type":"li",
            "html":"AAAA"
        }
    ]
});
//now i want append li tag
//tried...but don't work (create another ul with same id and name !!!!)
jQuery("#container").dform({
    "type":"ul",
    "name":"ulxx",
    "id":"ulxx",
    "html":[
        {
        "type":"li",
        "html":"BBBBBBBBBBB"
        }
    ]
});
</script>

尝试了...但是没有用(创建另一个具有相同id和名称的ul !!!!)

jQuery("#container").dform("append",{
    "type":"ul",
    "name":"ulxx",
    "id":"ulxx",
    "html":[
        {
        "type":"li",
        "html":"BBBBBBBBBB"
        }
    ]
});
你有什么想法吗?有一个“附加”方法,但不起作用

0 个答案:

没有答案