A: 

Maybe:

document.getElementById("input").value.replace(String.fromCharCode(150), "–");
Ross
Why 150? The numeric for ndash is 8211?
dacracot
It's the decimal ascii code for an ndash. Did you try it?
Ross
I tried it... It eliminates the ndash rather than substituting the entity. Curious.
dacracot
+1  A: 

Use its Unicode code point in a pattern literal

document.getElementById("input").value.replace( /\u2013/g, "–");
Peter Bailey