Ma io sostituiscvo solo i div alla tua stringa:

if (document.getElementById('t-h') && document.getElementById('t-c')) {


sbaglio qualcosa?