私は、私が選択してボタンに入力にreadonly
とreadonly
を適用しようとしています<section>
とjQueryのは、子要素の2種類
下の要素を切り替えるチェックボックスを持って、どのように私はjQueryのステートメントにそれをで達成できますか?
同じセレクタでjQueryをfind
に2回作成するにはどうすればよいですか?
$(this).parents('section')
.eq(0)
.find('input') <-- found all the inputs under <section>
.not('.cloud-media-toggle-inputs')
.prop('readonly', ! isChecked)
.find('select, button') <-- now I want to find all the <select>/<button> under <section>
.prop('disabled', ! isChecked);
を連鎖使用しないでくださいどのようにして、 "二度見つける"、意味ですか?すでにページのすべての要素が見つかりますが、多くの要素があります。セレクタが毎回何を変更しますか? – samiles
最初の 'prop()'の後ろに 'end'を入れて' section'要素に選択を返します –
@samiles質問のタイトルを再編集しました。 – Broshi