0
$(this).siblings("property2").hide().child("select").attr("disabled","disabled");

これは、クリックされたボタンの兄弟「property2」にアクセスして非表示にすることになっています。その後、「property2」の子「select」にアクセスし、「select」に無効属性を追加します。

しかし、これは機能していません。助けてください...ありがとう!

4

3 に答える 3

1
$(this).siblings(".property2").hide().children("select").attr("disabled","disabled");
  1. childに置き換える必要がありますchildren()

を使用している場合はproperty2、タグ name を持つ要素を選択しようとしていますproperty2。クラス名でアクセスしたい場合は になります.property2

無効なプロパティを削除する場合は、使用できます.removeAttr("disabled")

于 2010-12-09T05:31:36.180 に答える
0

property2それがクラスであり、選択がその要素の直接の子孫である と仮定します。

$(this)
    .siblings('.property2')
    .hide()
    .children("select")
    .attr("disabled","disabled");
于 2010-12-09T05:31:16.620 に答える
0
$(this).siblings(".property2").hide().children().attr("disabled","disabled");

やった…^^

于 2010-12-09T05:31:25.700 に答える