HTMLのクリアと削除
HTMLをクリアしたいときはempty
削除したい場合はremove
$("#test").empty(); // divは残る $("#test").remove(); // divもまるごと削除
<div id="test"> <p>今日も晴れ</p> </div>
HTMLをクリアしたいときはempty
削除したい場合はremove
$("#test").empty(); // divは残る $("#test").remove(); // divもまるごと削除
<div id="test"> <p>今日も晴れ</p> </div>