私はテーブルを持っていて、2つのタグがあります。非表示のボタンをクリックすると、$().empty() を使用して消えます。しかし、復元方法がわかりません。
$().append や新しいデータを追加するようなものは使いたくありません。復元したい。
どうやってやるの。ありがとう
<script type="text/javascript">
$(function(){
$('#hidden').click(function(){
$('.hidden').empty();
});
$('#restore').click(function(){
// restore defaults
});
});
</script>
<table>
<tr class="hidden">
<td>a</td>
<td>b</td>
</tr>
<tr>
<td>c</td>
<td>d</td>
</tr>
</table>
<input type = "button" id ='hidden' value="hidden"/>
<input type = "button" id ='restore' value="restore"/>