infoMore than 5 years have passed since last update.
jQueryを使ってタグの内容が空の場合はそのタグを削除する
Last updated at Posted at 2014-06-11
今後使いそうなのでメモ
$(function() {
$("p:empty").remove();
});
親要素を消したいとき
.parent()を使う
tableの場合
$(function() {
$("table tr td:empty").parent("tr").remove();
});
15Go to list of users who liked
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
What you can do with signing up