cell.textContent = val;

(`innerText` is non-standard and not supported by Firefox)