I am currently facing an issue with accessing elements that are automatically added by a library in my code. In my HTML, I have the following line:
<div class="bonds" id="original" style="display:block;"></div>
The library appends some elements within this <div>
. When inspecting the DOM, it looks something like this:
<div class="bonds" id="original" style="display:block;">
<!-- append start -->
<div class="FL-main fieldsLinker">
<div class="FL-left">
<select></select>
<ul>
<li data-offset="0"></li>
<li data-offset="1"></li>
<li data-offset="2"></li>
</ul>
</div>
</div>
<!-- append ended -->
</div>
I have tried to access the <ul></ul>
element using various methods, but nothing seems to work:
$('#original').children().children().children();
var original = $('#original').find('ul');
My ultimate goal is to insert
<span class="icon-close"></span>
within each <li></li>
element upon page load.