Hello,
The creators of jQuery could add a new method.
It will be used to indicate the closest element of the selector indicated, example:
- <div id="test">test</div>
- <br>
- <div class="hello">hello</div>
- <br>
- <div class="hello">hello</div>
- <script>$('#test').closestElement('.hello').text('haha'); OR $('#test').closestElement('div').text('haha');</script>
In this case it will return:
If exists a method equal to this, tell me.
Sorry For My English, i'm using the Google Translate.