-1

I have the string "how are you%3F" where "%3F" represents a question mark. How can I convert it back to "?" when adding it to an HTMl element in Javascript so that it renders human readable? It needs to work for all forbidden characters eg "<" "%3C"

var t = document.createTextNode("how are you%3F"); 

Maybe with a reg expression?

I may just be lacking proper terminology as I can't find anything about this in searches.

Thanks

Damon
  • 83
  • 8

1 Answers1

0
decodeURIComponent("how are you%3F");
upog
  • 4,965
  • 8
  • 42
  • 81