Skip to content

Instantly share code, notes, and snippets.

@faisalhmohd
Created October 25, 2016 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faisalhmohd/83d8f258f919194c36624f302cb046b4 to your computer and use it in GitHub Desktop.
Save faisalhmohd/83d8f258f919194c36624f302cb046b4 to your computer and use it in GitHub Desktop.
Hide child div's dynamically
var hideDivs = [2, 3]; // Enter the divs to be hidden
$( ".div" ).each(function() {
for(var i = 0; i < hideDivs.length; i++){
$(this).find('a:eq(' + hideDivs[i] + ')').hide();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment