Answer the question
In order to leave comments, you need to log in
How to add unicode string to html via javascript?
Hello, tell me please.
The & symbol in Unicode is "&" + "#38;" , if I directly enter it into html: <div id="div" title="&"></div>
Then in the end I get this result: <div id="div" title="&"></div>
Everything is super! BUT!
If I want to add unicode with js:
var div = document.getElementById('div');
div.setAttribute('title', "&");
<div id="div" title="&"></div>
<div id="div" title="&"></div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question