How do I select a sibling element using jQuery?

Use jQuery .siblings() to select the matching sibling.

Up vote 1 down vote favorite 1 share g+ share fb share tw.

$(". Auctiondiv . Auctiondivleftcontainer .

Countdown"). Each(function () { var newValue = parseInt($(this).text(), 10) - 1; $(this). Text(newValue); if (newValue == 0) { $(this).parent().fadeOut(); chat.

Verify($(this).parent().parent(). Attr('id')); } }); Basically, I want to select the element with . Bidbutton class that belongs in the same parent as the .

Countdown in the each loop: 0 Lance And then apply this to that button: $(button here). AddClass("disabled"); $(button here). Attr("disabled", ""); jquery selector link|improve this question edited Sep 19 '11 at 11:19Tchami2,302520 asked Sep 18 '11 at 17:49Sergio Tapia2,942321 83% accept rate.

Use jQuery .siblings() to select the matching sibling. $(this). Siblings('.

Bidbutton').

Thank you, worked fine. – Sergio Tapia Sep 18 '11 at 18:03 No problem, glad to help :) – Truth Sep 18 '11 at 18:10.

Since $(this) refers to . Countdown you can use $(this).next() or $(this). Next('button') more specifically.

Use the more general siblings solution. – Truth Sep 18 '11 at 17:53 1 Amazingly, it IS in his provided DOM and there's no reason to traverse ALL the siblings if he doesn't have to. – AlienWebguy Sep 18 '11 at 17:55.

Try - $(this). Siblings(". Bidbutton").

AddClass("disabled"). Attr("disabled", "").

Following code will help you $('. Bidbutton',$(this)).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions