Skip to content

Instantly share code, notes, and snippets.

@sonichandni
Created October 26, 2021 12:46
Show Gist options
  • Save sonichandni/699763ca84da7d19e9c55af6f2fe90ce to your computer and use it in GitHub Desktop.
Save sonichandni/699763ca84da7d19e9c55af6f2fe90ce to your computer and use it in GitHub Desktop.
js get elements
var th = $(this);
th.closest('.summary-input-div').nextAll('.summary-input-div:visible').first().find("input").focus();
// find any closest parent div
- closest();
// find any closest child div
- find();
// find only div which are visible in dom
- :visible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment