Javascript Placeholder (input) display ampersand text correctly? -
i have following code:
var inputsearchfield = document.createelement('input'); inputsearchfield.id = 'searchfield'; inputsearchfield.type = 'text'; inputsearchfield.placeholder = "rechercher un équipier"; searchdiv.appendchild(inputsearchfield); the result of above shows in browser (as placeholder text): rechercher un équipier
i expecting result be: rechercher un équipier.
is there way achieve above result?
you directly use respective unicode identifier, if document coded in utf8:
inputsearchfield.placeholder = "rechercher un \u00e9quipier";
Comments
Post a Comment