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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -