Jquery Descendant

Jquery children()

The children() method returns all children element of selected element.

$(document).ready(function(){
 $('span').children().addClass('active');
});


Jquery find()

The find() method returns descendant elements of selected element.

$(document).ready(function(){
 $('div').find('span').css({
  fontSize: '20px',
  color: 'black'
 });
});

Share this

Related Posts