I want to insert the space character into the innerHTML of a DOM element, but the space character must be declare in Unicode syntax.
For example, something like this: ...innerHTML += '\u83838383'
;
The RegExp \s Metacharacter in JavaScript is used to find the whitespace characters. The whitespace character can be a space/tab/new line/vertical character. It is same as [ \t\n\r].
In Javascript, the identifiers and string literals can be expressed in Unicode via a Unicode escape sequence. The general syntax is \uXXXX , where X denotes four hexadecimal digits. For example, the letter o is denoted as '\u006F' in Unicode. Hence, to write the letter “foo” in Unicode, we can use the following code.
Whitespace refers to characters which are used to provide horizontal or vertical space between other characters. Whitespace is often used to separate tokens in HTML, CSS, JavaScript, and other computer languages.
I am not quite sure what character you are hoping to get with 8383
- not to mention 83838383
, but it certainly doesn't seem to be the space character for any encodings I am familiar with. Are you by chance looking for:
= \u0020
 
= \u2002
 
= \u2003
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With