Copy code The code is as follows: <br>$(function() { <br><br>$("td").dblclick(function() { //Get tag<br>var td = $(this); <br>var itemid=td[0].id; <br> var txt = td.text(); <br>var input = $("<input type='text' value='" + txt + "'/>"); <br>td.html(input) ; <br>input.click(function() { return false; }); <br>//Get focus<br>input.trigger("focus"); <br><br>input.blur(function() { <br>var newtxt = $(this).val(); <br><br>if (newtxt != txt) { <br>td.html(newtxt); <br>var caid = $.trim( td.prev().text()); <br><br>/*Here do ajax to perform background operations<br><br>var url = "?a.php&itemid=" + itemid + "&v=" + newtxt ; //Depends on the website conditions <br><br>$.get(url, function(data) { <br>if(data=="1") <br>{ <br>location.reload() ; <br>td.html(txt); <br>return; <br>} <br>td.html(newtxt); <br>}); <br><br>} <br>else <br> { <br>td.html(newtxt); <br>} <br>}); <br><br>*/ <br><br>}); <br>}); <br></ script> <br> </div> <p align="left"></p> <div style="display:none;"> <span id="url" itemprop="url">http://www.bkjia.com/PHPjc/762212.html</span><span id="indexUrl" itemprop="indexUrl">www.bkjia.com</span><span id="isOriginal" itemprop="isOriginal">true</span><span id="isBasedOnUrl" itemprop="isBasedOnUrl">http: //www.bkjia.com/PHPjc/762212.html</span><span id="genre" itemprop="genre">TechArticle</span><span id="description" itemprop="description">Copy the code as follows: script type="text/javascript" $(function() { $("td" ).dblclick(function() { //Get tag var td = $(this); var itemid=td[0].id; var txt = td.text(); var...</span> </div> <div class="art_confoot"></div>