<div class="codetitle"> <span><a style="CURSOR: pointer" data="70512" class="copybut" id="copybut70512" onclick="doCopy('code70512')"><u>复代码</u></a></span> 代码如下:</div> <div class="codebody" id="code70512"> <br><div>값 가져오기:<input type="text" name="inputname" id="inputname"/> <br><div id="getvalue" style="display:none;"> <br><div id="tl"></div><div id="tr"></div> <br><table style="border:1px solid #ccc ;width:500px;text-align:left;"> <br><머리> <br><tr> <br>번호 <br>성 <br>이름 <br></tr> <br></머리> <br><tbody> <br><tr> <br><td>2</td> <br><td>싱</td> <br><td>ge</td> <br></tr> <br><tr> <br><td>3</td> <br><td>싱가드</td> <br><td>기드</td> <br></tr> <br><tr> <br><td>4</td> <br><td>싱싱</td> <br><td>ge</td> <br></tr> <br></tbody> <br><tfoot> <br><tr> <br><td>번호</td> <br><td>성</td> <br><td>이름</td> <br></tr> <br></tfoot> <br></테이블> <br></div> <br></div> <br> </div> <br>接下来我们写点JS代码实现这个功能: <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="62226" class="copybut" id="copybut62226" onclick="doCopy('code62226')"><u>复主代码</u></a></span> 代码아래:</div> <div class="codebody" id="code62226"> <br>$(document).ready(function(){ <br>$("#inputname").focus(function(){ <br>//alert('focus'); <br>$("#getvalue").css("display",'block')//显示表格 <br>.addClass('hover') <br>.find('table tr').dblclick(function() {//双击表格tr <br>var text=$(this).find("td:eq(0)").text();//获取表格td的第一个的文本值 <br>// 경고($text) <br>$("#getvalue").css('display','none');//隐藏表格 <br>$("#inputname").val(text);//赋值입력 <br>}) <br>}) <br><br> </div>