is there a way calling the createElement() method inside checkbox.off().on('click', function () {}) of checkBoxes() method? I cannot access the method inside the function within the method.
class Lists {
constructor() {
this.currentList = [];
this.completedList = [];
}
createElement(
value1 = undefined,
value2 = undefined,
value3 = undefined,
checkboxCheck = ''
) {
value3.append(`<li class="list-group-item p-3">
<input type="checkbox" ${checkboxCheck}/>
<span class="span-item">
${value1}
</span>
<div class="float-end">
<i class="fas fa-edit mx-2"></i>
<i class="fas fa-trash mx-2"></i>
</div>
<br />
<span class="span-time">${value2}</span>
</li>`);
}
checkBoxes() {
const checkbox = $('input[type=checkbox]');
checkbox.off().on('click', function () {
this.createElement(value1, value2...)
});
}
}