How to print a pound “£” in html file?

i am trying to display a pound sign in my html page.i want to display it through a variable because i am getting the values of sign from an xml file.

Here is Code:

var sign = $('#currencySign').text();
<div id="monthly_amt"></div>
<div id="currencySign">\u00A3</div>

and the out put is


and i want it as £450.33


How can I fix this?



You can use \u00A3 ...


Alternatively you can use entity name as &pound; or entity number as &#163; as well but you need to use .html() and NOT .text()

And use var and not Var

As you commented, I see you are getting more troubles with this, if you want you can accomplish this easily with CSS like

#monthly_amt:before {
    content: "'£'"; /* Or you can use \00a3 instead of £ */

And your jQuery will be

var monthlypayment = 1000;

And if the element is dynamically generated, you can get rid of it using .remove()

Demo 2


It is:




You can check other encodings here:

And here is a demo on how to do it: Online Demo

var sign = "&pound;";

To print a pound symbol, simply ... print the pound symbol:

var sign = '£';

$('#monthly_Amt').text(sign + monthlypayment);

Or, if that's somehow uncomfortable:

var sign = "\u00A3";

$('#monthly_Amt').text(sign + monthlypayment);  

Or, with the quotes:

$('#monthly_Amt').text("'" + sign + "'" + monthlypayment);  



It seems that the "variable" actually comes from an HTML element, but \x00A3 only works in string literals.

This HTML fixes it:

<div id="currencySign">&pound;</div>



Try this one,

£   &pound; &#163;  &#xA3;  Pound Sterling

See this Link

Try using:

var sign = '&#163;'

For the £ sign use: &#163; (ASCII Code)

EDIT: Using .text() will render the literal text, .html interprets it as an HTML element and will render special ASCII Characters using the ASCII codes.


Use &#163;

  • If you try this and it does not work, just change the jQuery methods,


This always work in all contexts...


May be you have to look into it.

<div id="divResponse">

$(document).ready(function () {
var sign = "\u00A3"
var monthlypayment = "5000"

here is the fiddle link : poundExampleJSFiddle

If this is helpful to you, please mark it as helpful.



Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us Javascript

©2020 All rights reserved.