Are you first timer at lazacode.org? Why not join us and start exchange your knowledge with everyone. Register today!

jQuery .find() method

0 votes
3 views
added Apr 2 in jQuery by LC Marshal Second Warrant Officer (6,010 points)

Find element in parent element

$('.sticky-prop-header').find('span.expiry_msg').fadeIn(400);

2 examples

0 votes
responded Apr 2 by LC Marshal Second Warrant Officer (6,010 points)
selected Apr 2 by LC Marshal
 
Best example

Find element only inside this parent element

$('.listing-summary').each(function(){
      var summaryprice = $('.price.at-summary').text();
      if ( summaryprice.length < 30 ) {
        $(this).find('span.expiry_msg').addClass('x-m-expired').fadeIn(400);
      }
      else {
        $(this).find('span.expiry_msg').fadeIn(400);
      }
    });
0 votes
responded Apr 2 by LC Marshal Second Warrant Officer (6,010 points)

$( "li.item-ii" ).find( "li" ).css( "background-color", "red" );

lazacode.org - Malaysia based Knowledge Exchange Platform, where you can share your finding or solution with other members of community.
...