I have a table in HTML with table rows, but some elements have an <span> elements inside, so i want to get the inner html of that span.
I have an array with all <tr> elements (not jQuery Objects, because I get it from the DataTables plugin API), so I have this code:
if (data[i+1].includes("span")) {
var label = $.parseHTML(data[i+1]);
// editFormInputs.eq(i).val(label.first().html());
} else {
editFormInputs.eq(i).val(data[i+1]);
}
So the problem is on the commented line. I tried to convert the html to jQuery element with parseHTML(), which returns an array. This works fine, but when I try to get the first element of the array with the first() function it gives me an error first() is not a function, so what I am doing wrong? Thanks.