Below is my code. First section is JS code and second is HTML.
$('#table').on('check.bs.table', function (e, row) {
checkedRows.push({First: row.fname, Second: row.sname});
var test = console.log(checkedRows);
document.getElementById("xyz").innerHTML=test;
});
<p id="xyz"></p>
I want to basically output first and last name from table to my html page but somehow it's not working. The console.log prints just fine when selecting rows from table. Again I want to access the selected data from console.log to view on my html page.
undefinedin a variable. (console.log doesn't return anything)console.log(checkedRows)returnsundefined, so you need to assign the value before you print it.