Thursday, March 16, 2017

Lab 12- My First JavaScript

      This lab was the first time I ever used Javascript. In order to complete this lab we were introduced to a knew topic which was forms and adding a function to a button. The purpose of this lab was able to create a form and create a button that will function using javascript. To start off we first used the form tag and before closing the form tag we had to give it a name. Then within the form tag we put the name, phone and email and next to each of them we put the input tag. However, when adding the input tag we must also add a name. The name well help us later on with javascript. After creating the form we had to create a button. Inside the button tag we must add the type, class and we definitely must add the onClick. In between the beginning and end of the tag, users are able to add a few words that will be seen on the front of the button. After creating the button, we wrote "Ready for the hidden part" within the h3 tag and we gave this tag an id named demo. Once creating the button it was time to add javascript to it. When using javascript we used internal javascript in which we started off by typing the element script. Next to the tag script we type function button() and then we add document.getElementById 9"demo').innerHTML="Hello". When typing this inside the script tag it tells the document to make the text Hello appear when you click the button you created earlier.
      This lab was not as difficult as I expected it to be. The steps were easy to follow. The best part of this lab was using css to style the features such as the button in the html code. I used this opportunity to try and experiment with different types of fonts by going to google fonts. I was also able to experiment with decorating the buttons such as adding a border, shadow, coloring the words,etc. I believe this lab was a good lab to start with because it gave us an introduction the to main features that we may use in our websites. This lab allowed me to learn how to link a javascript file to a html file externally. Overall, I know this is just the beginning and that javascript will get harder but I am ready to learn more in order to improve my labs and projects.



No comments:

Post a Comment