<div class="sample">
</div>
I would like to add data to the sample div on click. I am able to get the data to this function. verified with alert but it is not appending to the sample div.
$("#editsubmit").click(function(){
var val = $('[name=name111]').val();
var newHTML = '<input type="checkbox" name="'+val+'<br>';
$("#sample").append( newHTML );
});
samplein your case is a class. So use dot(".sample") instead.