I have strings like
var str = 'One & two & three';
rendered into HTML by the web server. I need to transform those strings into
'One & two & three'
Currently, that's what I am doing (with help of jQuery):
$(document.createElement('div')).html('{{ driver.person.name }}').text()
However I have an unsettling feeling that I am doing it wrong. I have tried
unescape("&")
but it doesn't seem to work, neither do decodeURI/decodeURIComponent.
Are there any other, more native and elegant ways of doing so?
For one-line guys: