I am trying to get a to appear after every third iteration of a for loop in jquery. I know in PHP it can be accomplished vi
Use the modulus operator instead.
if ( i && (i % 3 === 0)) { ...
Whenever there's no remainder, you're evenly divisible by 3.
3
I included the i && to eliminate the first iteration since 0 % 3 === 0; // true.
i &&
0 % 3 === 0; // true
Use this... just like your PHP
if (i % 3 == 0 )