The load
function is asynchronous.
Your next line runs before the content is loaded.
You need to put your code inside the load
function’s callback, so that it will only run after the new content is loaded:
$('#container').load('content.html', function() {
$('.elementInContentHTML').fadeIn();
});