<div class='my_class'></div>
<div class='my_class'></div>
<div class='my_class'></div>
<div class='my_class'></div>
jQuery('.my_class').hide();
jQuery('.some_other_class').live('click', function(){
// some other stuff that puts in another div with class 'my_class'
});
With this script, the first 4 divs will be hidden on load. However, when I click whatever, the new div will not be. How do I make it so that all future elements matching 'my_class' are automatically hidden as well?
EDIT
I found this here:
$("<style type='text/css'> .redbold{ color:#f00; font-weight:bold;}
</style>").appendTo("head");
$("<div/>").addClass("redbold").text("SOME NEWTEXT").appendTo("body");
This is more along the lines of what I would use. Much dryer.