For example, with a font-size switcher/button, if I use
$('#container p').css('font-size', '24px');
it works as expected, but if I later add paragraph elements to the container (via ajax, etc), they are not styled with the updated font-size. I am aware that this is the intended behavior of the .css()
method. I am simply asking:
What's the proper approach to changing a style for a CSS selector, and making those styles persistent?