-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCopy_task.html
More file actions
99 lines (75 loc) · 2.77 KB
/
Copy_task.html
File metadata and controls
99 lines (75 loc) · 2.77 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="css/style.css">
<body>
<h2>Copy task</h2>
Copy this extract from a New York Times article <u>by typing it</u> in the textbox below.<br>
Click the <b>download button</b> when you are finished.
<br>
<!-- https://www.nytimes.com/2017/03/15/nytnow/morning-routine-advice-from-times-readers-and-reporters.html -->
<p class="float-left" id='prompt' >Drinking alcohol gives me horrific migraines, so I stopped entirely. The problem: I used to bond with my friends at fancy cocktail bars and happy hours. I don’t make my drinking their problem, and I’ve told them I’d still like to go with them. (They know I quit drinking because of migraines, not a substance problem.) Still, they often exclude me when they go to bars or alcohol-centered activities. I feel rejected. Some of them even ask: “Are your migraines really that bad?” How should I handle this?</p>
<br style="clear:both" />
<textarea oncopy="return false" onpaste="return false"
cols="72" rows="10" id="lname" name="lname" spellcheck="false">
</textarea>
<br style="clear:both" />
<button onclick="countWords()">
Count Words
</button>
<br>
<p> Word Count:
<span id="show">0</span>
</p>
<div id="buttons" class="btn1">
<a id="downloadAnchorElem"><span>Download</span></a>
</div>
<div id="buttons">
<a id="resetTexbox"><span>Reset</span></a>
</div>
<br style="clear:both" />
<br style="clear:both" />
<!-- <div id="buttons2" class='btn2'>
<a href="Spontaneous_task1.html"><span>Next</span></a>
</div> -->
<br style="clear:both" />
<script src="js/keylog_copy.js"></script>
<br style="clear:both" />
<br style="clear:both" />
<script>
function countWords() {
// Get the input text value
var text = document
.getElementById("lname").value;
// Initialize the word counter
var numWords = 0;
// Loop through the text
// and count spaces in it
for (var i = 0; i < text.length; i++) {
var currentCharacter = text[i];
// Check if the character is a space
if (currentCharacter == " ") {
numWords += 1;
}
}
// Add 1 to make the count equal to
// the number of words
// (count of words = count of spaces + 1)
numWords += 1;
// Display it as output
document.getElementById("show")
.innerHTML = numWords;
}
</script>
<!--
<script>
document.querySelector('.btn2').style.display = 'none';
// document.querySelector('.btn1').addEventListener('click', showBtn);
// function showBtn(e) {
// document.querySelector('.btn2').style.display = 'block';
// e.preventDefault();
// }
</script> -->
</body>
</html>