removed needless files
This commit is contained in:
parent
59f337210c
commit
277d070199
|
@ -1,42 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Startit</title>
|
||||
<meta charset=utf-8/>
|
||||
|
||||
<style>
|
||||
h1 {
|
||||
color: blue;
|
||||
}
|
||||
div {
|
||||
color: blue;
|
||||
background-color: lightblue;
|
||||
padding: 10px;
|
||||
margin: 10px;
|
||||
border: solid green 2px;
|
||||
}
|
||||
.selected {
|
||||
border: dashed orange 5px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="overskrift" class="selected">Hello World !</h1>
|
||||
|
||||
<div onclick="heiPåDeg(this)">ipsum dolor sit amet, consectetuer adipiscing elit.</div>
|
||||
|
||||
<div onclick="heiPåDeg(this)" class="selected">
|
||||
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae dolor. Nullam tristique diam non turpis. Cras placerat accumsan nulla. Nullam rutrum. Nam vestibulum accumsan nisl.
|
||||
</div>
|
||||
<div onclick="heiPåDeg(this)">Trykk her</div>
|
||||
<script>
|
||||
var teller = 0;
|
||||
function heiPåDeg(tagElement) {
|
||||
teller++;
|
||||
tagElement.innerHTML = 'x';
|
||||
document.getElmentById('overskrift'.innerHTML =
|
||||
'Du har trykket ' + teller + ' ganger';
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,73 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Opptaksoppgave</title>
|
||||
<style>
|
||||
div {
|
||||
color: blue;
|
||||
background-color: lightblue;
|
||||
padding: 10px;
|
||||
margin: 10px;
|
||||
border: solid green 2px;
|
||||
width: 30px;
|
||||
height: 30x;
|
||||
float: left;
|
||||
}
|
||||
div.førstPåLinja {
|
||||
clear: left;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<div id="r1k1" onclick="trykk(this, 'r1k2','r2k1', 'r2k1', 'r2k1')">7</div>
|
||||
<div id="r1k2" onclick="trykk(this, 'r1k1','r1k3', 'r2k2', 'r2k2')">1</div>
|
||||
<div id="r1k3" onclick="trykk(this, 'r1k2','r2k3', 'r2k3', 'r2k3')">2</div>
|
||||
|
||||
<div id="r2k1" class="førstPåLinja" onclick="trykk(this, 'r2k2','r1k1', 'r3k1', 'r3k1')">5</div>
|
||||
<div id="r2k2" onclick="trykk(this, 'r2k1','r1k2', 'r2k3', 'r3k2')"></div>
|
||||
<div id="r2k3" onclick="trykk(this, 'r2k2','r1k3', 'r3k3', 'r3k3')">3</div>
|
||||
|
||||
<div id="r3k1" class="førstPåLinja" onclick="trykk(this, 'r2k1','r3k2', 'r3k2', 'r3k2')">8</div>
|
||||
<div id="r3k2" onclick="trykk(this, 'r3k1','r2k2', 'r3k3', 'r3k3')">4</div>
|
||||
<div id="r3k3" onclick="trykk(this, 'r3k2','r2k3', 'r2k3', 'r2k3')">6</div>
|
||||
|
||||
<button id="riktig" onclick="test(this)">sjekk her</button>
|
||||
|
||||
<script>
|
||||
function trykk(tagElement, alt1, alt2, alt3, alt4) {
|
||||
if(document.getElementById(alt1).innerHTML == '') {
|
||||
document.getElementById(alt1).innerHTML = tagElement.innerHTML;
|
||||
tagElement.innerHTML = '';
|
||||
}
|
||||
if(document.getElementById(alt2).innerHTML == '') {
|
||||
document.getElementById(alt2).innerHTML = tagElement.innerHTML;
|
||||
tagElement.innerHTML = '';
|
||||
}
|
||||
if(document.getElementById(alt3).innerHTML == '') {
|
||||
document.getElementById(alt3).innerHTML = tagElement.innerHTML;
|
||||
tagElement.innerHTML = '';
|
||||
}
|
||||
if(document.getElementById(alt4).innerHTML == '') {
|
||||
document.getElementById(alt4).innerHTML = tagElement.innerHTML;
|
||||
tagElement.innerHTML = '';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
function test() {
|
||||
var array = ['r1k1', 'r1k2', 'r1k3', 'r2k1', 'r2k2', 'r2k3', 'r3k1', 'r3k2', 'r3k3'].map(id => document.getElementById(id).innerHTML);
|
||||
let svar = [1,2,3,4,5,6,7,8,''];
|
||||
if (array.toString() == svar.toString()) {
|
||||
alert('Hurra!!');
|
||||
}
|
||||
else {
|
||||
alert('Sjekk consolen')
|
||||
console.log(array === svar);
|
||||
console.log(array);
|
||||
console.log(svar);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue