Html entities must be encoded in alt attribute of an image in HTML page. So
>
JavaScript has its own system for escaping special characters in strings:
document.getElementById('formula').alt = 'A \u2192 B';