Jquery input get value of self and sibling inputs on event -
i trying value of input (radio button) when clicked on , value of siblings. using jquery can value of siblings code below, can't think of how include value of selected element itself.
options = $(button).siblings('input:checkbox:checked').map(function () { return this.value; }).get();
you can traverse parent element , find checked elements in ensure not considering current checkbox when unchecked:
$(button).parent().find('input:checkbox:checked').map(function () { return this.value; }).get();
Comments
Post a Comment