如何使用jquery创建动态树结构

时间:2014-04-01 07:07:31

标签: jquery css3

我正在尝试使用具有以下结构的jquery和css来创建动态树结构

1级         - 1a级                选项                       是还是不是 如是        - 1a级               是或否(动态)

如果没有        - 1a级               是或否(动态)

Reference Image

1 个答案:

答案 0 :(得分:1)

我得到了解决方案,我希望这对您的问题有所帮助。

<form name="f1" method="post" action="">
<div id="container">
<ul>

<li><input type="text" id="txt_1" name="q_0_1" class="margin_top_o"></li>
<li  class="margin_left ">
 <span class="tree-connector">No</span>
<input type="text" id="txt_2" value="Y_1" name="Y_1" class="margin_ng">

<div class="romvebtn">
<button type="button" id="2" class="remove ">Remove</button>
</div>
<button type="button" id="1" class="ul-appending ">Expand</button></li>
<li  class="tree-lastsib">
<span class="tree-connector">Yes</span>
<input type="text" id="txt_3" value="Y_2" name="Y_2" class="margin_ng">
<div class="romvebtn">
<button type="button" id="2" class="remove ">Remove</button>
</div>
<button type="button" id="2" class="ul-appending tt">Expand</button></li>
</ul>
</div>
</form>

for more details plese review this link.