This is selected HTML elements:
var array = jQuery.makeArray($(".dersprg tr td:nth-child(6)"));
this selects some table data which consists of table header text and some irrelevant data. I can interpret the irrelevant data using if statements and extract the information i need, but i can not push it to the array since the types are not the same I suppose. Code is like this:
for(i=0 ; i<array.length ; i++){
content = array[i].innerHTML;
if(some conditions){
array.splice(i--,1); //eliminate non day elements
array.push('test input <br>'); //problematic line
}
}
You see, i use innerHTML to compare the content of selected <td> element, but when it comes to adding some test input the whole array renders empty. I think this is due to type mismatch, but i could not figure out how i can solve this. Any help is highly appreciated.
Try this :
This will insert a
<td>in the array instead of a string.