Edit in JSFiddle
JavaScript
Result
$('<div class="y">xxx</div>') .appendTo("html"); alert($('.y').length);