I have the following JQuery code:
$(this).text('Options ▴');
However, the ascii code isn't showing up on my web page. All that shows up is on the webpage is Options ▴
.
What am I doing wrong?
Inserting ASCII characters To insert an ASCII character, press and hold down ALT while typing the character code. For example, to insert the degree (º) symbol, press and hold down ALT while typing 0176 on the numeric keypad. You must use the numeric keypad to type the numbers, and not the keyboard.
The ASCII value of the lowercase alphabet is from 97 to 122. And, the ASCII value of the uppercase alphabet is from 65 to 90.
It can be observed that ASCII value of digits [0 – 9] ranges from [48 – 57]. Therefore, in order to print the ASCII value of any digit, 48 is required to be added to the digit.
Use the .html()
method instead of .text()
.
The whole point of .text()
method is to make the text appear exactly as it's in the string, with all tags and entities.
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