Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
オプション パネルには、ユーザーが Twitter ユーザー名を入力できるセクションがあります。現在、そのフィールドの値が空の場合、Twitter アイコンは引き続き Web サイトに表示されますが、値が空の場合は表示されないようにしたいと考えています。
Twitter アイコンを表示する div クラスが「.twitter」と呼ばれる場合、「mytheme_twitter」という入力 ID の値が空の場合、これを非表示にするにはどうすればよいでしょうか?
if($('#mytheme_twitter:empty')){$('.twitter').hide();}
複数の Twitter クラスがある場合、これによりすべてが非表示になります。それ以外の場合は、非表示にする Twitter クラスのセレクターが必要になります。