For example, if you have five paragraphs in a row and you need to insert a break tag in between all of them. You can’t put it before all five (you don’t need one at the top) or after all five (you don’t need one at the bottom), you only need four.
$("p:not(:last-of-type)").after("<br />");
This will also work..
$("p:not(:first-of-type)").before("");
there’s supposed to be a break tag between those quotes.
:first-of-type is not a selector filter so the sinppent doesn’t work.
Here is the correction
$('.parent_of_target_p_tags').children('p.not(:last-child)').after('');
According to my CSS Pocket Reference book, “:first-of-type” is indeed a selector filter.