I'm not sure what I'm doing wrong. It's probably very obvious. Works on codepen, but when testing on my site, I receive the error: 'TypeError: row is undefined'
HTML:
<table class="tabletable">
<tr class="fee">
<th>Name</th>
<td>--</td>
</tr>
</tfoot>
</table>
Javascript:
function feefee(){
var row = document.getElementsByClassName("fee")[0];
for (i=0; i<1; i++) {
var x = row.insertCell(2);
x.innerHTML = "New cell";
}
}
function feefee();
Here is a codepen where it works fine, unfortunately it doesn't work on-site: http://codepen.io/xkurohatox/pen/XdZEyQ?editors=1010
I am attempting to add a new cell after div class .fee td.
No jQuery answers please. Thank you!