-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathtest.html
58 lines (47 loc) · 1.62 KB
/
test.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Test for jquery-s2t</title>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.9.1/jquery.min.js"></script>
<script type='text/javascript' src="jquery.s2t.js"></script>
<script type="text/javascript">
var isSimplified = true;
$(function() {
$('#btn-convert').click(function() {
if (isSimplified) {
var text = $('#text-result').text();
$('#text-result').text($.s2t(text));
$('#content-wap').s2t();
$('.para').s2t();
isSimplified = false;
$(this).text('繁');
} else {
var text = $('#text-result').text();
$('#text-result').text($.t2s(text));
$('#content-wap').t2s();
$('.para').t2s();
isSimplified = true;
$(this).text('简');
}
});
});
</script>
</head>
<body>
<button id='btn-convert'>简</button>
<h1>文本测试</h1>
<p id='text-result'>我是程序员!</p>
<h1>HTML Element测试</h1>
<div id='content-wap'>
<p alt='我是程序员!' title='我是程序员!'>我是程序员!</p>
<p alt='我是程序员!' title='我是程序员!'>我是程序员!</p>
<ul>
<li>我是程序员!</li>
<li>我是程序员!</li>
</ul>
</div>
<h1>HTML Elements测试</h1>
<p alt='我是程序员!' title='我是程序员!' class='para'>我是程序员!</p>
<p alt='我是程序员!' title='我是程序员!' class='para'>我是程序员!</p>
</body>
</html>