<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script Language="JavaScript" src="http://code.jquery.com/jquery-1.4.1.js"> </script> <title></title> </head> <body> <script type="text/javascript"> $(document).ready(function(){
$(".A").hover(
function () { var text = $(this).text(); $(this).text(''); $(this).append("<input type='text' value='"+text+"' />") }, function () { var valueText = $(this).children("input").val(); $(this).text(valueText); } ); }); </script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script Language="JavaScript" src="http://code.jquery.com/jquery-1.4.1.js">
</script>
<title></title>
</head>
<body> <script type="text/javascript">
$(document).ready(function(){
$(".A").hover(
function () {
var text = $(this).text();
$(this).text('');
$(this).append("<input type='text' value='"+text+"' />")
},
function () {
var valueText = $(this).children("input").val();
$(this).text(valueText);
}
);
}); </script>
<table border="2" cellspacing="2" cellpadding="2"
style="margin-top: 5px;">
<tr>
<td>用户:</td>
<td class="A" style="width:150px;">
</td>
</tr>
<tr>
<td>年龄:</td>
<td class="A" style="width:150px;"></td>
</tr>
</table>
</body>
</html>