JavaScript: Unicode character

I want to insert a space character in the innerHTML element of the DOM element, but the space character must be declared in Unicode syntax.

For example, something like this ...innerHTML += '\u83838383':;

+3
source share
1 answer

I'm not quite sure what character you hope to get with 8383 - not to mention 83838383, but this, of course, is not a space character for any encodings that I'm familiar with. You are randomly looking for:

  • ASCII Space = & nbsp; = '\ u0020'
  • En Space = & ensp; = '\ u2002'
  • Em Space = & emsp; = '\ u2003'
+10
source

Source: https://habr.com/ru/post/1731502/


All Articles