I'm trying to select only paragraphs where align="center" (inline styling).
jQuery(p.MsoNormal).attr('align', 'center').addClass('av-tablecell');
This seems to select all paragraph elements, even without align=center.
I'm trying to select only paragraphs where align="center" (inline styling).
jQuery(p.MsoNormal).attr('align', 'center').addClass('av-tablecell');
This seems to select all paragraph elements, even without align=center.
Try like below,
jQuery('p.MsoNormal[align=center]').addClass('av-tablecell');
Your code is setting the "align" attribute on p.MsoNormal to "center". You need to include it in your selection to get only the elements that already have "align=center" like so:
jQuery('p.MsoNormal[align="center"]').addClass('av-tablecell');