function displayContent(a) {
var content = $("#" + a).html().trim();
alert(content);
$('#temstoredivid').append(
"<div class='maincover' id='maincov1'>" +
" <div class='subcover' id='subcover1'> </div>" +
" <div class='forclose' id='forcloseid1'> </div>" +
"</div>"
);
$('#temstoredivid .maincov1').html(content);
}
displayContent('myElement');
I'm trying to display the value of the selected element in the subcover div with id "subcover1". The code snippet above is what I've tried so far, but it's not working as expected. Any assistance would be greatly appreciated. Thank you.