Last active
August 29, 2015 14:11
-
-
Save s0ren/cba059a142c52280a3f4 to your computer and use it in GitHub Desktop.
Sig hej til verden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Vær velkommen</title> | |
<script type="text/javascript"> | |
var clickHej = function() { | |
alert("Hej med dig"); | |
} | |
</script> | |
</head> | |
<body> | |
<button id="hejKnap" onclick="clickHej()">Davs</button> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Vær velkommen, kære ven!</title> | |
<script type="text/javascript"> | |
var clickHej = function() { | |
var navn = document.querySelector("#navn").value; | |
alert("Hej " + navn + adgang); | |
} | |
</script> | |
</head> | |
<body> | |
Hvad hedder du, men lille ven?<input type="text" id="navn" /><br> | |
<button id="hejKnap" onclick="clickHej()">Davs</button> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Vær velkommen, eller skrid!</title> | |
<script type="text/javascript"> | |
var checkAdgang = function(alderen) { | |
if (alderen < 12) | |
{ | |
return " Du er for lille! Gå hjem til din mor."; | |
} | |
else | |
{ | |
return " Velkommen!"; | |
} | |
} | |
var clickHej = function() { | |
var alder = document.querySelector("#alder").value; | |
var adgang = checkAdgang(alder); | |
var navn = document.querySelector("#navn").value; | |
alert("Hej " + navn + adgang); | |
} | |
</script> | |
</head> | |
<body> | |
Hvad hedder du, men lille ven?<input type="text" id="navn" /><br> | |
og hvor gammel er du så?<input type="range" id="alder" max="20"> | |
<button id="hejKnap" onclick="clickHej()">Davs</button> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment