xxxxxxxxxx
//siblings()
$(document).ready(function(){
$("h2").siblings();
});
//next()
$(document).ready(function(){
$("h2").next();
});
//nextAll()
$(document).ready(function(){
$("h2").nextAll();
});
//nextUntil()
$(document).ready(function(){
$("h2").nextUntil("h6");
});
xxxxxxxxxx
Use jQuery .siblings() to select the matching sibling.
$(this).siblings('.bidbutton');
xxxxxxxxxx
$( "li.third-item" ).siblings().css( "background-color", "red" );
xxxxxxxxxx
// Retrieve all sibling elements of an element with id "myElement"
var siblings = $('#myElement').siblings();
// Iterate over the retrieved sibling elements
siblings.each(function() {
// Do something with each sibling element
console.log($(this).text());
});