<div id="divWrapper">
<input id="firstInput"/>
<div id="insideDiv">
<input id="secondInput"/>
</div>
</div>
This is the basic structure of my HTML. So, given an access to "divWrapper" element how do I check if it contains "secondInput".
NOTE: This is to be done without jQuery. Only using Angularjs utility functions.
UPDATE: The solution should be dynamic. Meaning it should find any child, how much ever down the level it is in the DOM tree.
UPDATE 2: Please don't get misguided by "input" element. I don't want to track the text inside it. I want to a logic which will check if me or any of my child is clicked. If NOT then hide myself and my children.