0

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:

<div id="monthly_amt"></div>
<div id="currencySign">\u00A3</div>

js code:

var sign =$('#currencySign').text();
var monthlypayment = 1000;
$('#monthly_amt').html("\'" + sign +"\'" + monthlypayment);

output is

'\u00A3'1000
\u00A3

js fiddle example is

http://jsfiddle.net/VT2J2/

user2142786
  • 1,484
  • 9
  • 41
  • 74

1 Answers1

1

Simply do this, no need of quotes, just concate both variables and it should work:

$('#monthly_amt').html( sign + monthlypayment);

UPDATED FIDDLE

Ehsan Sajjad
  • 61,834
  • 16
  • 105
  • 160