<!DOCTYPE
html PUBLIC "-//W3C//DTD XHTML 1.0 Transit
ional//EN" "
Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> 选择器
测试 </title>
<style type="text/
CSS">
.txtobj{background-color: #6600FF;}
</style>
<script type="text/
javascript" src="../jquery-1.5.1.min.
js"></script>
<script language="JavaScript" type="text/javascript">
$(document).ready(
function()
{
$("input[type='text']")
.click
(
function()
{
this.value=$("#lblMsg")[0].innerText;
}
)
.keydown(
function()
{
alert($("#divTest")[0].innerText);
alert($("#lblMsg")[0].innerHTML);
alert($("#txtTest")[0].value);
return false;
}
);
}
);
</script>
</head>
<body>
<table width="400" border="1" cellpadding="0" cellspacing="0">
<tr>
<td><span id="lblMsg">0123456789</span></td>
</tr>
<tr>
<td>
<input type="text" id="txtTest" class="txtobj" value="@#$message test"/>
</td>
</tr>
</table>
<div id="divTest">ABCDEFGHIJKLMNOPQRSTUVWXYZ</div>
</body>
</html>
0