I am trying to loop through multiple p elements using JQuery to show and hide them but I just can't get it to work. I've also tried a for loop. The current shows and hides all the p elements and I would like to show and hide them one after the other. Here's my code:
HTML
<p hidden="" class="tweet-1">"Lorem Ipsum"</p>
<p hidden="" class="tweet-2">"Lorem Ipsum"</p>
<p hidden="" class="tweet-3">"Lorem Ipsum"</p>
etc
JQuery
var i=0
$("p").each(function() {
$(".tweet-" + i).show().hide();
i+=1
});