I have this following where I would like to dynamically add the list elements to it:
<ul name='eval-options' class="inputs-list">
</ul>
I’m adding the list elements with the following js but it is not working
$("#eval-options ul").append('<li><label><input type="checkbox" name="optionsCheckboxes" value="option1" /><span>Option one</span></label></li>');
First of all, declare the ul with an
idof eval-options, instead of aname.Secondly, the string for your selector should be
The selector you’re currently using:
means “the ul element contained as a child of any element with the identifier
eval-options“