jquery - how can I consider $(this)? -


this question has answer here:

hello have doubt $(this) in jquery. doing exercise, @ end of script can see:

$(this).before(quote); 

can consider $(this) temporary variable contains value of loop? in how can consider $(this)?

$(document).ready(function() {    $('span.pq').each(function() {      var quote = $(this).clone();      quote.removeclass('pq');      quote.addclass('pullquote');      $(this).before(quote);    }); //end each  }); // end ready

$('span.pq') return list of elements array of elements. $(this) element of $('span.pq') array of elements.

$(this) equal $('span.pq')[index] // index variable of each loop.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -