Monday, December 24, 2018

Lab14 My First Javascript

In this lab, I created a webpage with javascript in it. First I opened up Dreamweaver. I created a new document by clicking New and OK. Secondly, I typed in my html code. I typed in !Doctype html, HTML tags, body tags, head tags,  meta charset="UTF-8", title tags which had Lab14 inside, comments, link rel tags which displayed my favicon at the top left hand corner of the tab. Inside the body tags, I had center tags, headings that said my title, date, Digital Design, and Lab14. After the heading tags, I put my name plate by inserting img src tag with a link to my image of the name plate that showed my name. Nextly I typed in two br tags to break up the content. Then I typed in a button tag to have a button to my webpage. Afterwords, I typed in p id="demo" style="color:red;" with b tags, and inside those b tags I wrote "Once you click the button above, it changes the text permanently!". Next I typed in the javascript for my code. I typed in //create a function for button function myfunction() {/* this will call the function and rewrite html tag*/ document.getElementById("demo").innnerHTML="Hello Javascript";}. This javascript combined with the button create an action where if you press the button it changes the text permanently to Hello Javascript. After that I inserted a br tag to break up the content. Then I placed in my banner with by inserting img src with the link to the banner image. Lastly I saved the document and uplouded it to the servers. Knowing how to use javascript is important for a web designer because I allows the webdesigner to make better websites and make the websites function in ways HTML and CSS couldn't do. 

Link to Lab14:http://techteach.us/Web2020/ZWeiJian/Labs/Lab_14/Lab14.html 

No comments:

Post a Comment