Can you help me with this jQuery selector?
$(\".auctiondiv .auctiondivleftcontainer .countdown\").each(function () {
var newValue = parseInt($(this).text
Since $(this)
refers to .countdown
you can use $(this).next()
or $(this).next('button')
more specifically.
also if you need to select a sibling with a name rather than the class, you could use the following
var $sibling = $(this).siblings('input[name=bidbutton]');
Try -
$(this).siblings(".bidbutton").addClass("disabled").attr("disabled", "");
Use jQuery .siblings() to select the matching sibling.
$(this).siblings('.bidbutton');
jQuery provides a method called "siblings()" which helps us to return all sibling elements of the selected element. For example, if you want to apply CSS to the sibling selectors, you can use this method. Below is an example which illustrates this. You can try this example and play with it to learn how it works.
$("p").siblings("h4").css({"color": "red", "border": "2px solid red"});
If you want to select a specific sibling:
var $sibling = $(this).siblings('.bidbutton')[index];
where 'index' is the index of the specific sibling within the parent container.