-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
38 lines (33 loc) · 1.48 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function fillText(){
for(var i=1; i <= 9; i++){
var text = document.getElementsByName("input"+i)[0].value;
var spanTag = document.getElementById("word"+i);
spanTag.textContent = text;
}
var pElement = document.getElementById("adLibParagraph");
pElement.hidden = false;
}
</script>
</head>
<body>
<form onsubmit="fillText(); return false;">
<label>Name:</label><input type="text" name="input1" />
<label>Location:</label><input type="text" name="input2" />
<label>Adjective:</label><input type="text" name="input3" />
<label>Another Name:</label><input type="text" name="input4" />
<label>Animal:</label><input type="text" name="input5" />
<label>Action:</label><input type="text" name="input6" />
<label>Object:</label><input type="text" name="input7" />
<label>Group Activity:</label><input type="text" name="input8" />
<label>Location:</label><input type="text" name="input9" />
<button type="submit">Fill It In!</button>
</form>
<p id="adLibParagraph" hidden>
<span id="word1"></span> loved coding at the <span id="word2"></span> it was SO <span id="word3"></span>. His/her best friend was <span id="word4"></span>, a <span id="word5"></span> that could <span id="word6"></span> a <span id="word7"></span>. Their favorite thing to do together was to <span id="word8"></span> in the <span id="word9"></span>.
</p>
</body>
</html>