Sunday, September 28, 2014

Lab 2




                                                                                      In lab 2, we learned how to 
 write our name in JavaScript. We used the code <script> x= "IT'S MY NAME...." document.write ("Akampreet" +x) </script> in this lab. But, if you test the code on a brower, it would come out as "Akampreet ITS'S MY NAME." The "x" in the code represents a variable and after the "=", we write what we want to write in the HTML content using "". First, we  wrote "Hello World!" then, we 
                                                                                    wrote our name in the bottom of it.

I can use this code in the future to write JavaScript inside my html document using <script></script>. In addition, I know how to use variables in my code such as "x" or "=".

No comments:

Post a Comment