JSFiddle - React, Tailwind, and code Playground
by BuriB
HTML
<br/><hr/><br/>
<form id="h_01">
<input name="a" value="abc" /><br/>
<input name="b" value="123" /><br/>
<input name="c" value="asdf" /><br/>
</form>
<br/><hr/><br/>
<form id="h_02">
<input name="a" value="abc" />
<input name="b" value="123111" />
<input name="c" value="123123123dasdf" />
</form>
<br/><hr/><br/>
<form id="h_03">
<input name="a" value="abcd" />
<input name="b" value="asdf" />
<input name="c" value="234324" />
</form>
<br/><hr/><br/>
<form id="h_04">
<input name="a" value="abcfadsf" />
<input name="b" value="asdf" />
<input name="c" value="asasdfasdfdf" />
</form>
JavaScript
/**
* Task
* looking for a FORM that has input with multiple name + key value
*/
var getFields = function() {
return $('input[name="a"][value="abc"]').parents('form').find('input[name="b"][value="123"]') .parents('form');
};
console.log( getFields() ) ;