Statistics
| Revision:

root / tmp / org.txm.core / bin / org / txm / js / test_sel.html @ 54

History | View | Annotate | Download (561 Bytes)

1
<!doctype html>
2
<html>
3
<head>
4
<meta charset="utf-8">
5
<title>Demo</title>
6
</head>
7
<body>
8
<button >TEST SELECTION</button>
9
<script src="http://code.jquery.com/jquery-latest.js"></script>
10
<script src="jquery.selection.js"></script>
11
<script>
12
$( document ).ready(function() {
13
$( "button" ).click(function( event ) {
14
var sel = window.getSelection()
15
alert( $(sel).find("span");
16
event.preventDefault();
17

18

19
});
20
});
21
</script>
22

    
23
<p>
24
<span id="w_0" title="un">un</span> <span id="w_1" title="premier">premier</span> <span id="w_2" title="mot">mot</span>
25
</p>
26
</body>
27
</html>