javascript arrays are like below,
var course_ids = (1, 2, 3, 4);
var selected = (1, 3);
for (var x = 0; x < course_ids.length; x++) {
if (selected.find(checkCourse)) {
table_data += "<td>true</td>";
} else {
table_data += "<td>false</td>";
}
}
$('#exam_tbl tr:last').append(table_data);
function checkCourse(course_id) {
return course_id;
}
html table contain all course_ids
as th
in a table row. Then i want to load selected
into next row. but if selected course is there i want to show true in td
else want to show false.
sample is like below.
---------------------------------
| 1 | 2 | 3 | 4 | //th
----------------------------------
|true |false |true |false | //td
-----------------------------------
please help me to do this.