forked from ftlabs/fastclick
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10.html
More file actions
26 lines (26 loc) · 926 Bytes
/
10.html
File metadata and controls
26 lines (26 loc) · 926 Bytes
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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<style type="text/css">
p { font-family: sans-serif; }
textarea { width: 25em; height: 5em; }
</style>
<title>#10</title>
<script type="application/javascript" src="../lib/fastclick.js"></script>
<script type="application/javascript">
window.addEventListener('load', function() {
new FastClick(document.body);
document.getElementById('select').addEventListener('focus', function(event) {
event.target.setSelectionRange(0, event.target.value.length);
}, false);
}, false);
</script>
</head>
<body>
<textarea>FastClick is instantiated on the document body. Try and select the text in this textarea.</textarea>
<br><br>
<textarea id="select">The text in this textarea should be selected automatically when focussed.</textarea>
<p>Now try and select the text in this paragraph.</p>
</body>
</html>