14-01-2017, 23:56
Her er en anden opgave med delopgaver, jeg ikke kunne finde ud af:
------------------------------------------------------------------------------------------------------------------------------------------------------------
Given is the following HTML website code
1) Draw the Document Object Model of this website as a tree. Start with the Document root and the <html> tag, see example sketch below. Draw all DOM elements (but not character data). (on paper)
2) You want to access the value of the input lastname and store it in a new variable called temp. Write one line of Javascript code that can do this for you.
3. Explain one advantage of tables, and one advantage of divs, for the positioning of elements in a website layout
------------------------------------------------------------------------------------------------------------------------------------------------------------
Hvordan får man lavet DOM elementerne?
Jeg har prøvet at lave <table> og <div>, men jeg ved ikke om de har en særlig fordel?
------------------------------------------------------------------------------------------------------------------------------------------------------------
Given is the following HTML website code
Kode:
<html>
<head>
<title> A Name Form </title>
</head>
<body>
<h1>Your name </h1>
<form>
First name:
<input type="text name="firstname">
<br>
Last name:
<input type="text name="lastname">
</form>
</body>
</html>
2) You want to access the value of the input lastname and store it in a new variable called temp. Write one line of Javascript code that can do this for you.
3. Explain one advantage of tables, and one advantage of divs, for the positioning of elements in a website layout
------------------------------------------------------------------------------------------------------------------------------------------------------------
Hvordan får man lavet DOM elementerne?
Jeg har prøvet at lave <table> og <div>, men jeg ved ikke om de har en særlig fordel?