Seeking a more efficient and streamlined approach for appending and removing appended spans, divs, or text. Below is the code snippet - any insights on what could be improved?
/* HTML CODE */
<div id="appendHere" style="padding:10px;border:solid 1px red"></div>
/* Jquery CODE */
$('#appendHere').on('click' , function() {
$('#appendHere').append('<span style="padding:10px;border:solid 1px green;">Simple text</span>');
});
$('#appendHere span').on('click' , function() {
$(this).remove();
});