-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
37 lines (33 loc) · 1.08 KB
/
index.html
File metadata and controls
37 lines (33 loc) · 1.08 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ctrlZ</title>
<script src="js/jquery.min.js" language="javascript"></script>
<script src="js/jquery.ctrlZ.js" language="javascript"></script>
<!-- <link rel='stylesheet' href='css/styles.css' type='text/css'/>
-->
</head>
<body>
<h1>CtrlZ jQuery plugin</h1>
<p>With this plugins, you can use ctrl+z and ctrl+y on your textareas, even when they are modified by external plugins or javascript routines</p>
<textarea cols="30" rows="10" id="target"></textarea>
<br>
<input type="button" value="Click here to add some text to the textarea" onclick="$('#target').val($('#target').val()+' '+prompt('Type some texte here','Some text'))">
<p>And you can cancel it by pressing ctrl+z when the textarea is in focus. Yey !</p>
</body>
</html>
<script>
jQuery(document).ready(function () {
$("textarea").ctrlZ();
setTimeout(function(){
$('#target').val('coucou');
},500);
setTimeout(function(){
$('#target').val('coucou les');
},1000);
setTimeout(function(){
$('#target').val('coucou les copains');
},1500);
});
</script>