Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery: How to text insert HTML ascii character?

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?

like image 755
JGreig Avatar asked Apr 28 '10 05:04

JGreig


People also ask

How do I enter an ASCII code?

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.

What is the ASCII value of A to Z?

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.

What is the ASCII code for 0 to 9?

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.


1 Answers

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.

like image 158
Fyodor Soikin Avatar answered Sep 30 '22 23:09

Fyodor Soikin