When I try to update my page elements using ajax, I encountered a problem: the fmt:message tag doesn't work when I set it in javascript.
In the JSP page everything works fine:
<div id="div">
<fmt:message key="search_select_country"/>
</div>
But after using javascript, it no longer works:
document.getElementById("div").innerHTML = "<fmt:message key=\"search_select_country\"/>";
P.S. However, if I simply do this, it works:
document.getElementById("div").innerHTML = "It works";
Question: Why is the fmt:message not working? And what can I do to fix it?