I am developing a Chrome extension and trying to iterate over elements of a webpage that has multiple instances of the format shown below:
<div class="wrapper">
<span class="loud" style="text-decoration: none;">...</span>
<div class="leave-gap">...</div>
<p>"Some text"</p>
<span id="id_12345" class="none">...</span>
<div class="block-footer">...</div>
<div class="leave-gap">...</div>
</div>
Basically, under certain conditions I will be hiding between the first class leave-gapand the class block-footer.
I suggest finding classes loudas follows:
$('.wrapper .loud').each(function()
{
var $a = $(this);
...
Assuming I'm using form syntax $a.next()to search for each subsequent element, how would I define the element class?
Is there a faster way to do this than our solution?
Thanks in advance.
source
share