master
Tait Hoyem 2 years ago
parent 99c012cfca
commit 49a6e90ee7

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head></head>
<body>
<script type="text/javascript">
var dudes = new Array("Bucky", "Dan", "Randy");
var chicks = new Array("Lisa", "Erin", "Hannah");
var people = chicks.concat(dudes);
document.write(people);
</script>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head></head>
<body>
<script type="text/javascript">
var movies = new Array("Avatar", "Good Will Hunting", "Vanilla Sky", "Fight club");
document.write(movies[3] + "<br/>");
movies.pop();
document.write(movies[3]);
movies.pop();
</script>
</body>
</html>

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head></head>
<body>
<script type="text/javascript">
var bp = new Array("head", "shoulders", "knees", "toes");
bp.reverse();
bp.push("tounge", "liver");
bp.sort();
var string1 = bp.join();
document.write(string1);
</script>
</body>
</html>

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head></head>
<body>
<script type="text/javascript">
var crap = new Array(3);
for(i=0;i<3;i++){
crap[i] = prompt("Add something to the ARRAY:", "");
}
document.write(crap[0], crap[1], crap[2]);
</script>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head></head>
<body>
<script type="text/javascript">
var stuff = new Array("apples", "pears", "tuna", "ham");
stuff.sort();
for(i=0;i<stuff.length;i++){
document.write(stuff[i] + "<br/>");
}
</script>
</body>
</html>

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head></head>
<body>
<script type="text/javascript">
var bucky = new Array();
bucky["color"] = "blue";
bucky["food"] = "hot pockets";
document.write("buckys favourite food is " + bucky["color"]);
</script>
</body>
</html>

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head></head>
<body>
<script type="text/javascript">
var n = prompt("Enter a number:", "");
var answer = Math.sqrt(n);
alert("The square root of " + n + " is " + answer);
</script>
</body>
</html>

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head></head>
<body>
<script type="text/javascript">
function printTime(){
var now = new Date();
var hours = now.getHours();
var mins = now.getMinutes();
var seconds = now.getSeconds();
document.write(hours+":"+mins+":"+seconds+"<br/>");
}
setInterval("printTime();", 1000);
</script>
</body>
</html>

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head></head>
<body>
<form>
<label for="username">Username</label>
<input id="username" type="text" />
<input type="submit" value="Submit" />
</form>
<script type="text/javascript">
var x = document.forms[0].length;
document.write(x);
</script>
</body>
</html>

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head></head>
<body>
<form id="buckyForm">
<label for="username">Username</label>
<input id="username" type="text" name="username"/>
<label for="password">Password</label>
<input id="password" type="password" name="password"/>
</form>
<script type="text/javascript">
var x = document.buckyForm.username.name;
document.write(x);
</script>
</body>
</html>
Loading…
Cancel
Save