在标签标签中输入后打印文字?

时间:2014-07-23 11:40:48

标签: html json2html

我有json数据,我想在label标签内的输入标签之后打印文本,但是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"
                                            }
                                        ]
                                    }
                                ]
                            },

1 个答案:

答案 0 :(得分: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 ",
                                        }
                                    ]