To output the "scissors" symbol from Unicode, I request them by code like this:

alert(String.fromCharCode(&#x2702)); 

However, there is no alert. Wrapped the code in quotes, still no. Tell me where was wrong?

  • 2
    JS is not HTML. See how the numbers are written in javascript (as in other cases, and most other PLs). alert(String.fromCharCode(0x2702)); works great ... - Mike

1 answer 1

The String.fromCharCode method takes a number as an argument. You try to transfer to it an invalid (from the point of view of JS) construction. Quoting this construct does not help either, since, I repeat, you need a number .

Here is an example of how to pass a hex number as an argument:

 alert(String.fromCharCode(0x2702)); 

JSFiddle working example .