我有一个问题,试图弄清楚为什么我的container
无法识别它有children
。孩子们越过网格而无法工作。我尝试为子项创建一个无序列表(附加值),但这不起作用。我该如何解决这个问题?
JSFiddle:https://jsfiddle.net/bdfndp9h/1/
<div class="container text-slim">
<div class="box square">
<ul class="no-style">
<li class="sub-container-title">Additional Item Specifics <i class="fa fa-info-circle" aria-hidden="true" data-toggle="tooltip" data-placement="right" title="Use this to track listings using your own Product Identification Number (PIN)."></i></li>
<li class="sub-container-input add-more-half">
<div class="inputs_container"></div>
<input type="text" name="text_area" class="text_area add-more-input ib" placeholder="Add your own item specific" maxlength="30" />
<span class="input-group-btn">
<button class="btn btn-default add_input_submit ibb" type="button">+</button>
</span>
</li>
<li class="sub-container-input add-more-half">
<div class="checkbox_container"></div>
<input type="text" name="text_area" class="text_area add-more-input cb" placeholder="Add additional accessories" maxlength="30" />
<span class="input-group-btn">
<button class="btn btn-default add_checkbox_submit cbb" type="button">+</button>
</span>
</li>
</ul>
</div>
</div>
尝试将此添加到我的CSS
,但这无济于事
.no-style {
height: auto;
list-style: outside none none;
margin: 8px 0 0;
padding: 0;
}
这些是children
,在附加或者点击+ button
时会留下框容器
var input_content = $('.ib').val();
$('.inputs_container').append('<ul class="no-style added-container input-group" id="newinput'+countinput+'"><li class="added-input-title">'+input_content+'</li><li class="added-input-body"><input type="text" class="add-more-input ib" id="input'+countinput+'"><span class="input-group-btn"><button class="btn btn-default ibb" id="inputbutton'+countinput+'" onclick="removeinput('+countinput+')" type="button">-</button></span></li></ul>');
$('.ib').val('');
});
var input_content = $('.cb').val();
$('.checkbox_container').append('<ul class="no-style added-container input-group" id="newcheck'+countcheck+'"><li class="added-checkbox-body"><input type="checkbox" id="check'+countcheck+'"><span>'+input_content+'</span><span><button class="no-border" id="inputcheck'+countcheck+'" onclick="removecheck('+countcheck+')">x</button></span></li></ul>');
$('.cb').val('');
});