For example, when using the font-size / button switch, if I use
$('#container p').css('font-size', '24px');
it works as expected, but if I add paragraph elements to the container later (via ajax, etc.), they will not be in the style of the updated font size. I know that this is the intended behavior of the method .css(). I'm just asking:
What is the correct style change approach for the CSS selector and the persistence of these styles?
source
share