Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery sibling

// Sibling with class name 
$(this).next( ".someClassNameOfSibiling" ).css( "display", "none" );

// Full code for for h3 element on click 
// hide the sibling div element
$(document).ready(function(){ 
  $("h3").on("click",function() {
    $(this).next( "div" ).css( "display", "none" );   
  })
});
Source by api.jquery.com #
 
PREVIOUS NEXT
Tagged: #jquery #sibling
ADD COMMENT
Topic
Name
2+5 =