dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: Can Anyone help me?

  1. #1
    Join Date
    Feb 2003
    Posts
    2

    Can Anyone help me?

    Can anyone teach me how to write a javascript that creates an array called month. Assign following values to this object:

    “January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November, “December”.

    Print out all the 12 months from the Web Browser.

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    <script type="text/javascript">
    <!--
    document.write(['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']);
    // -->
    </script>


    Or, if you prefer:

    <script type="text/javascript">
    <!--
    document.write('<ul><li>', ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'].join('</li><li>'), '</li></ul>');
    // -->
    </script>


    For further JavaScript requests, please consult the JavaScript forum.
    Last edited by Charles; 02-23-2003 at 07:33 AM.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  3. #3
    Join Date
    Feb 2003
    Posts
    2

    Please help me to solve.I'm a fresh beginner to javascript.

    2. Write a javascript that display the following table after entering a number. The number of rows displayed will depend on the number that is entered. The following output is obtained when a number 2 is entered:

    You have entered 2

    Row number
    1
    2


    3. Write a javascript that creates an object prototype called car.

    i) A car must have the following properties.
    make, model, year, capacity.

    ii) Instantiate four cars with different properties and them print out from a web browser.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles