If i specify an input field value like this:
<input type="text" id="requiredField" value="Lait écrémé"/>
The text will show in the input as: Lait écrémé, howvever if I do this with jQuery.val()…
$("#requiredField").val("Lait écrémé");
It will not show correctly…
Any suggestions for this problem? Or could this be a jQuery bug? Is there a command to convert this?
Note: the page is utf8
The purpose of those html entities is that you can avoid using unicode encoding. If you are using uncode encoding such as utf-8 properly, they are pointless.
Anyways,
valdoesn’t automatically decode them, it just takes the literal value. You can use this trick to get them decoded: