<html><body><script>
//Fonction de suppression d'un item dans la liste
function supprimer_noeud(id){
var noeud = document.getElementById(id);
noeud.parentNode.removeChild(noeud);
}
//Création des éléments
var ul = document.createElement("ul");
var li = document.createElement("li");
li.setAttribute("id", "5");
if(document.all) {
li.onclick = function() { supprimer_noeud(this.id); };
} else {
li.setAttribute("onclick", "javascript:alert('moncul')");
}
li.appendChild(document.createTextNode("contenu liste"));
ul.appendChild(li);
document.body.appendChild(ul);
</script>
</body>
</html>