Can someone tell me whats wrong with this script
$(this).siblings("property2").hide().child("select").attr("disabled","disabled");
This is supposed to access the sibling "property2" of a clicked button and hide it. After that it will access the child "selec开发者_开发问答t" of "property2" and add a disabled attribute to "select".
But this is not working. Help please ... thanks!
$(this).siblings(".property2").hide().children("select").attr("disabled","disabled");
child
should be replaced withchildren()
If you are using property2
then you are trying to select elements with tag name property2
. If you want to access by classname then it will be .property2
.
If you want to remove the disabled property then you can use .removeAttr("disabled")
Assuming that property2
is a class, and that the select is a direct descendant of that element:
$(this)
.siblings('.property2')
.hide()
.children("select")
.attr("disabled","disabled");
$(this).siblings(".property2").hide().children().attr("disabled","disabled");
did it ... ^^
精彩评论