-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.html
More file actions
72 lines (65 loc) · 2.03 KB
/
Copy pathdemo.html
File metadata and controls
72 lines (65 loc) · 2.03 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
<!DOCTYPE HTML>
<html>
<head>
<title> demo </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script type="text/javascript" src='jFun.js'></script>
<script type="text/javascript">
<!--
$.ready(function()
{
function tag(name,html,attr){return "<"+name+" "+(attr||"")+">"+html+"</"+name+">"}
function td(html,attr){return tag("td",html,attr);}
function tr(html,attr){return tag("tr",html,attr);}
function table(html,attr){return tag("table",html,attr);}
var sTable = "", sTr = "", sTd;
for(var i=0; i<20; i++)
{
sTd = "";
for(var j=0; j<20; j++)
sTd += td(i+""+j);
sTr += tr(sTd)
}
sTable = table(sTr,"border=1 width='100%'");
$("#table").html(sTable);
$("td").attr(".clicked='red'",".bgcolor='white'",".backup=.bgcolor");
$("#table").on("td",
{ "mouseover":function(){$(this).attr(".bgcolor='yellow'")},
"mouseout": function(){$(this).attr(".bgcolor=.backup")},
"click":function()
{
$(this).attr(".bgcolor=.clicked"
,".clicked=.backup"
,".backup=.bgcolor")
}
}
);
$("#input")
.each(function(){this.select();})
.keydown(function(event)
{
if(event.keyCode===13)
$("*:button").click();
})
$("*:button").click(function()
{
$('*:not(:button)').css('bg:white');
$(ID('input').value).css('bg:red');
})
})
//-->
</script>
</head>
<body>
<div id="" class="" align='center'>
<input style="width:772px;" type="text" id="input"
value='tr(:=8,:=9) :each(td:lt(9):gt(3));td(:nth-child(4),:nth-child(10),:nth-child(15),:=13,:=15,:=-5,:=-7)'/>
<input type="button" value="select" onclick="">
</div>
<div id="table" class="">
</div>
</body>
</html>