Answer the question
In order to leave comments, you need to log in
Why do the characters Yo and Y split in two?
how to enter the characters Y and Y as whole unicode characters?
<span onclick='ввод_символа("й");'>Й</span> //побуквенный ввод
var слово = редактируемая_строка.textContent; //введенное слово
for (var x=0; x< слово.length; x++) //разбор слова и вывод его побуквенно
{
var буква = document.createElement('span');
буква.textContent = слово[x];
document.appendChild(буква);
};
Answer the question
In order to leave comments, you need to log in
In unicode, a character can be represented as one or two characters, depending on the type of normalization: habrahabr.ru/post/45489
You can try using the normalize () method: 'ё'.normalize('NFC').length == 1
- true
while 'ё'.normalize('NFD').length == 2
- true
https://jsfiddle.net/hvh4h9j2/
didn't detail anything.
Alternatively, also like this https://jsfiddle.net/0r9t1h6o/1/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question