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

jQuery .find() method

0 votes
10 views
added Apr 2 in jQuery by LC Marshal Lieutenant (13,870 points)

Find element in parent element

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

2 Responses

0 votes
responded Apr 2 by LC Marshal Lieutenant (13,870 points)
selected Apr 2 by LC Marshal
 
Best response

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 Lieutenant (13,870 points)

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

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...