Question toute bête : comment passer une entité HTML ("→" dans mon exemple) dans du code javascript ?
Mes essais restent infructueux.
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-15" />
<title></title>
<script type="text/javascript">
function fleche()
{
div = document.getElementById("test");
texte = document.createTextNode("→");
div.appendChild(texte);
}
window.onload = function()
{
fleche();
}
</script>
</head>
<body>
<div id="test"></div>
</body>
</html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-15" />
<title></title>
<script type="text/javascript">
function fleche()
{
div = document.getElementById("test");
texte = document.createTextNode("→");
div.appendChild(texte);
}
window.onload = function()
{
fleche();
}
</script>
</head>
<body>
<div id="test"></div>
</body>
</html>
Merci d'avance pour vos réponses.