$(this).siblings("property2").hide().child("select").attr("disabled","disabled");
これは、クリックされたボタンの兄弟「property2」にアクセスして非表示にすることになっています。その後、「property2」の子「select」にアクセスし、「select」に無効属性を追加します。
しかし、これは機能していません。助けてください...ありがとう!
$(this).siblings(".property2").hide().children("select").attr("disabled","disabled");
child
に置き換える必要がありますchildren()
を使用している場合はproperty2
、タグ name を持つ要素を選択しようとしていますproperty2
。クラス名でアクセスしたい場合は になります.property2
。
無効なプロパティを削除する場合は、使用できます.removeAttr("disabled")
property2
それがクラスであり、選択がその要素の直接の子孫である と仮定します。
$(this)
.siblings('.property2')
.hide()
.children("select")
.attr("disabled","disabled");
$(this).siblings(".property2").hide().children().attr("disabled","disabled");
やった…^^