confused - creating an uordered list using document.write

Posted on 2012-09-02
Last Modified: 2012-09-02
hello there, newbie here.

I'm trying to create an unordered list with document.write and am having trouble.  these are the objects I'm using:


I've attempted to set them as individual variables using  var li1=  then setting each like li1=document.write...

Then created :

            <li>" + li1 + "</li>
 ....and so on.

Hopefully I have explained this well enough, but my brain is a bit foggy from working on this for so long now.  I'm trying to see where I'm going wrong.  Does anyone know of or can show me an example on how to create the document.write 's as an unordered list?  Thank you very much... this is due in a few days so any promptness is greatly appreciated!! :)
Question by:hazydays
    LVL 10

    Assisted Solution

    You need to place the value from navigator object into a variable. Then you can print that value using document.write();
    var foo = navigator.appCodeName;

    Open in new window

    Is this homework?

    Research variables first.

    Then look at how document.write works:
    LVL 10

    Accepted Solution

    Have a look at this example:

    Click the "Run" button to execute the code. You can edit the source code directly and run your changes. Hopefully this helps you see how accomplish your goal. You can do the same with the unordered list.

    Author Closing Comment

    Thank you so much!!  The jsfiddle was what really cinched it for me.  I realized I was adding document.write to the var and once I eliminated that part, it worked!!  I truly appreciate the resources!!  yes, this was homework but I only wanted some guidance which you provided beautifully.  Cheers!
    LVL 10

    Expert Comment

    Awesome. Thanks for the kind words and welcome to EE.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    In Part 1 ( we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
    Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
    In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
    In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now