0

I have a list of names in JavaScript, eg name = "John&martin" but in the display in my interface it looks like John&martin, with ampersand character printed as & not as &.

I worked with the UTF-8 or even with the ASCII code, but I find no result. How to print & character as & not as &?

rachedbch
  • 41
  • 2
  • 7

1 Answers1

-1

This is a shot in the dark without more context, but have you tried changing the name from:

name = "John&martin"

to:

name = "John\&martin"

?

Xarus
  • 6,589
  • 4
  • 15
  • 22