$(document).ready(function() { // encapsulate all functions in document ready function
// this is the strm array, in order to have a proper array you must have values inside "value" separated by ,
var strm = ["111", "201", "345", "434", "532", "677", "790", "890", "989", "118", "107", "136", "125", "153", "142"];
// execute mo, pass strm array to function.
mo(strm);
// mo function with array as input value
function mo(array) {
// jQuery.each() method.
// pass array as input value.
$.each(array, function(i, val) { // << index and value of each item in strm array
// if i is less than or equal to the number of elements with class mo,
if (i <= $(".mo").length) {
// get element with class mo equal to strm array index, insert value
$(".mo").get(i).append(val);
}
});
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table id="tbl" class="tbl1">
<tr>
<th>
mobileno
</th>
<td class='mo' id="mo_0">
</td>
</tr>
<tr>
<th>
mobileno
</th>
<td class='mo' id="mo_1">
</td>
</tr>
<tr>
<th>
mobileno
</th>
<td class='mo' id="mo_2">
</td>
</tr>
<tr>
<th>
mobileno
</th>
<td class='mo' id="mo_3">
</td>
</tr>
<tr>
<th>
mobileno
</th>
<td class='mo' id="mo_4">
</td>
</tr>
<tr>
<th>
mobileno
</th>
<td class='mo' id="mo_5">
</td>
</tr>
</table>