I have a table, shown below:
Name 相关标签: 2条回答 陌清茗 2021-01-18 11:43 You don't even need Javascript/jQuery: <table> <tr> <td><input type="text" value="My Thing"></td> </tr> </table> input { border:none; } input:active { border:1px solid #000; } ...just use CSS to style the input to look like a span. 0 讨论(0) 发布评论: 提交评论 加载中... 情话喂你 2021-01-18 11:46 $('#editParamValues').click(function () { $('tr td:nth-child(3)').each(function () { var html = $(this).html(); var input = $('<input type="text" />'); input.val(html); $(this).html(input); }); }); 0 讨论(0) 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
You don't even need Javascript/jQuery:
<table> <tr> <td><input type="text" value="My Thing"></td> </tr> </table> input { border:none; } input:active { border:1px solid #000; }
...just use CSS to style the input to look like a span.
$('#editParamValues').click(function () { $('tr td:nth-child(3)').each(function () { var html = $(this).html(); var input = $('<input type="text" />'); input.val(html); $(this).html(input); }); });