1

我有 json 数据,我想在标签标签内的输入标签之后打印文本,但 json2html 在输入标签之前打印文本!

jon2html 结果:

<div class="checkbox">
      <label> **one**
        <input name="checkbox" id="checkbox1" value="checkbox1" type="checkbox">
      </label>
</div>

我想要的结果:

<div class="checkbox">
      <label> 
        <input name="checkbox" id="checkbox1" value="checkbox1" type="checkbox"> 
        **one**
      </label>
</div>

json:

"tag": "html",
"children": [
    {
        "tag": "body",
        "children": [
            {
                "tag": "div",
                "class": "form-group",
                "html": " ",
                "children": [
                    {
                        "tag": "label",
                        "class": "col-lg-2 control-label",
                        "html": "option"
                    },
                    {
                        "tag": "div",
                        "class": "col-lg-9",
                        "id": "checkbox",
                        "html": " ",
                        "children": [
                            {
                                "tag": "div",
                                "class": "checkbox",
                                "html": " ",
                                "children": [
                                    {
                                        "tag": "label",
                                        "html": " one ",
                                        "children": [
                                            {
                                                "tag": "input",
                                                "name": "checkbox",
                                                "id": "checkbox1",
                                                "value": "checkbox1",
                                                "checked": "",
                                                "type": "checkbox"
                                            }
                                        ]
                                    }
                                ]
                            },
4

1 回答 1

0

您可以在这样的输入之后添加另一个 div 吗?

                            "tag": "div",
                            "class": "checkbox",
                            "html": " ",
                            "children": [
                                {
                                    "tag": "label"
                                    "children": [
                                        {
                                            "tag": "input",
                                            "name": "checkbox",
                                            "id": "checkbox1",
                                            "value": "checkbox1",
                                            "checked": "",
                                            "type": "checkbox"
                                        },
                                        {
                                            "tag": "div",
                                            "html": " one ",
                                        }
                                    ]
于 2014-07-23T12:01:18.103 回答