I have a datatable having a column with an input field. To get the data from table I'm using:
table.rows().data().toArray();
Im getting the result array, but for the column with input field I'm getting the whole html of input field and not just the value.
eg. '<input type="text" value="someValue"></input>'
How can I manipulate the code to get the value of input in result Array. TIA.
CodePudding user response:
table
.rows()
.data()
.toArray()
.map((el) => {
if(el.includes('<input')){
return el.split('value="')[1].split('"')[0]
}
})