► It is a reference to an HTML object, but document.title does not contain HTML; it contains plain text. For example, if I set document.title to <strong>Hello</strong> <em>world</em> , it would display it literally and not show the Hello world. The same goes for any other part of HTML, including entity references.
To be clear, you can include entity links in the title tag. They will be interpreted when analyzing the page. Nevertheless, document.title gets access to the text after its analysis and replaces all entities. document.title will access the title tag, not the HTML inside it, which was originally used to create it. Similarly, setting document.title does not make the HTML inside it automatically interpreted.
Including a character literally can cause problems if the browser for some reason interprets your page in a different character encoding than it actually is. HTML objects protect against this in HTML, but there is also a way to avoid them in JavaScript. In particular, you can include ► in JavaScript with the escape code of the string \u25ba . (9658 10 converted to base 16 is 26BA 16 )
source share