


It enables the presentation of many blank spaces.īelow is how your code would look if you didn’t use the   character entity. The   character entity is used in HTML. Use   to Add Non-Breaking Spaces in HTMLīecause the browser will only display one blank space no matter how many characters you have in your code, HTML has the   character entity. After that, you can safely view them in your browser. You must utilize their respective character entities ( ) if you want to use them as “greater than†and “less thanâ€. HTML may misinterpret them as opening and closing tags if you use them in your code. What Are Character Entities in HTMLĬharacter entities are used in the browser to show various characters.įor example, the less than symbol ( ) in HTML are reserved for tags. ONLINE-RUNNER:browser var text 'a u00A0u00A0u00A0 b' // U+00A0 console. Quick solution: use the following u00A0 character code. This article shows how to create any number of blank spaces we want in our code and add a non-breaking space with the   character entity in HTML. In this very short article, we are going to look at how to insert a no-break (non-breaking) space character to string in JavaScript.
