I am dynamically creating a label and input inside a ul. I need to wrap the label and input inside an li. I've tried wrap, append, appenTo, and before. I can't figure it out. Here is the code.
const departments = $('#departments ul');
for (let i = 0; i < len; i++) {
let num = response[i][0];
let description = response[i][1];
$('<input />', {type: 'checkbox', id: +num, value: description}).appendTo(departments);
$('<label />', {'for': +num, text: description}).appendTo(departments);
}