little more from the mvc chapter
This commit is contained in:
parent
ed7c48e877
commit
cafa3b8957
6 changed files with 87 additions and 27 deletions
|
@ -1,11 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="app"></div>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
21
oppgaver/uke4/adjektichistorie/script.js
Normal file
21
oppgaver/uke4/adjektichistorie/script.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
// Model Variabler
|
||||
let sentence = ""
|
||||
let words = ["Green", "Red", "Cat", "Man", "Started", "Jumped", "Pool", "Wall"];
|
||||
|
||||
// View
|
||||
// HTML, onclick CSS
|
||||
updateView();
|
||||
function updateView() {
|
||||
document.getElementById('app').innerHTML = 'Dette er ____';
|
||||
document.getElementById('app').innerHTML = /*HTML*/ `
|
||||
<button>${words[0]}</button><button>${words[1]}</button>
|
||||
<button>${words[2]}</button><button>${words[3]}</button>
|
||||
<button>${words[4]}</button><button>${words[5]}</button>
|
||||
<button>${words[6]}</button><button>${words[7]}</button>
|
||||
`;
|
||||
};
|
||||
|
||||
// Controller endrer modellen
|
||||
function insertWords() {
|
||||
|
||||
}
|
0
oppgaver/uke4/adjektichistorie/style.css
Normal file
0
oppgaver/uke4/adjektichistorie/style.css
Normal file
Loading…
Add table
Add a link
Reference in a new issue