Fix text handling for browsers without innerText.