簡體   English   中英

使用HTML編碼的特殊字符的document.getElementById(foo).value?

[英]document.getElementById(foo).value with html encoded special characters?

我似乎無法在一個簡單的輸入文本字段中正確渲染特殊字符。 例如以下

é

應該是é,但呈現為原始值

document.getElementById("inputKeyword").value ="Cherchez par mot clé"

那是html編碼,在javascript中沒有用。

document.getElementById("inputKeyword").value = "Cherchez par mot clé";

要么

document.getElementById("inputKeyword").value = "Cherchez par mot cl\u00e9";

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM