Javascript pour créer un li et les ajouter à l'ol

Je suis en train d'utiliser JavaScript pour créer un li et l'ajouter à un ol. Le code que j'utilise est

<ol id=summaryOL>
</ol>

function change(txt) {
var x=document.getElementById("summaryOL");
newLI = document.createElementNS(null,"li");
newText = document.createTextNode(txt);
newLI.appendChild(newText);
x.appendChild(newLI);
}

change("this is the first change");
change("this is the second change");

Ces devrait ressembler à:

1. this is ...
2. this is ...

Mais regardez comme:

this is the first changethis is the second change

J'ai créé un violon à: violon . Merci pour toute aide.

InformationsquelleAutor Andrew Clear | 2012-02-02