I have two different queries I would like to unify them in a single query. One is a query which tracks an HTML element which contains a word as text:
var component = ".component";
$(component).find(".search-here:contains('test')");
<tr class="search-here">
<td>test</td>
</tr>
var component = "#form";
$(component).find("input[type='text']:input[value*='test']").closest('.search-here');
<div class="search-here">
<input type="text" value="test, test1, test2">
</div>
Try something like $(component).filter("[type='text'],[value*='test'],:contains('test')").closest('.search-here')
As long as the input has a type = text or a value with test in it, it will return.
Demo
var component = ".search-here *";
var s = $(component).filter("[type='text'],[value*='test'],:contains('test')").closest('.search-here');
console.log($(s).length)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form id="form">
<div class="search-here">
<input type="text" value="test, test1, test2">
</div>
<div class="search-here">
<input type="number" value="run"/>
</div>
</form>
<table>
<tr class="search-here">
<td>test</td>
</tr>
</table>