Skip to content Skip to sidebar Skip to footer

Problems With Validating A Document When Trying To Create A Nested List Using Javascript

Here is my whole document. I'm having problems with the part in the head that starts with var tabNom1 and in the body after 'Partie 2: Affichage du contenu HTML à partir de JavaS

Solution 1:

As noted to the answer to the first iteration of this question, update your body script as follows:

<script type="text/javascript">
//<![CDATA[
    document.write("<ul>");
    document.write("<li>" + "Equipier numéro 1:");
    document.write("<ul>");
    for (x in tabNom1) 
    {document.write("<li>" + tabNom1[x] + "<\/li>");}
    document.write("<\/ul><\/li><\/ul>");
//]]>
</script>

That's adding CDATA and escaping the / in your closing elements.

See http://www.w3resource.com/javascript/document-alert-confirm/writing-text.php for examples.


Post a Comment for "Problems With Validating A Document When Trying To Create A Nested List Using Javascript"