dag 3 commit 1

This commit is contained in:
Geir Okkenhaug Jerstad 2024-08-09 10:23:56 +02:00
parent 8bc31be735
commit 06bd2966ca
6 changed files with 58 additions and 1 deletions

View file

@ -0,0 +1,14 @@
<!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=""/>
<script src="script.js"></script>
</head>
<body>
</body>
</html>

View file

@ -0,0 +1 @@
console.log("Hello world");

View file

@ -0,0 +1,6 @@
let firstName, lastName;
firstName = 'Geir';
lastName = 'Jerstad';
console.log(firstName, lastName);
const JUL_2024 = '24.12.2024';
console.log(JUL_2024);

View file

@ -15,7 +15,8 @@
<button>Grid layout</button> <button>Grid layout</button>
<h1>Eksempel 1</h1> <h1>Eksempel 1</h1>
<div id="tekstDiv">Start Tekst Her</div>
<button onclick="oppdaterTekst()">Trykk på knappen for å oppdatere tekst</button>
<div id="cards"> <div id="cards">
<div class="card"> <div class="card">
<div class="header green"> <div class="header green">

32
intro html/js.html Normal file
View file

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h3>Introduksjon til JavaScript</h3>
<ol>
<li>Finne frem til en tagg</li>
<li>Endre HTML</li>
<li>Trekke ut som funksjon</li>
<li>kalle andre funksjoner<br /></li>
</ol>
<h3>Så bruker vi JavaScript til dette</h3>
<ol>
<li>Åpne og Lukke</li>
<li>Velge hode</li>
</ol>
<div id="geirsTagg">(tom)</div>
<button onclick="newText()">Trykk her</button>
<script>
function newText() {
document.getElementById('geirsTagg').innerHTML = 'Ny tekst'
}
</script>
</body>
</html>

3
intro html/script.js Normal file
View file

@ -0,0 +1,3 @@
function oppdaterTekst() {
document.getElementById('tekstDiv').innerHTML = 'Ny tekst nå som knappen er trykket på';
}