JavaScript Basics Tutorial - Assignment answers

  1. JavaScript is case-sensitive. Thus, using DOCUMENT.WRITE instead of document.write will result in an error.

  2. Forgetting to include the quotes results in an error. The text needs to be surrounded by quotes and placed inside parenthesis.

  3. <script language="JavaScript" type="text/javascript">
    <!--
    document.write("Your-name-here");
    //-->
    </script>
    

  4. <script language="JavaScript" type="text/javascript">
    <!--
    document.write("It's a good day to die");
    //-->
    </script>
    

  5. <script language="JavaScript" type="text/javascript">
    <!--
    document.write('He said, "Welcome to my world."');
    //-->
    </script>
    
    Note: The double quotes are surrounded by single quotes.