开发者

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");
  1. child should be replaced with children()

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 ... ^^

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜