<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 );
           });  
                Class and id attributes mismatch.you have given as class and selecting as ID
 $(".sample").append( newHTML );
or change your div to
<div id="sample">  and then  $("#sample").append( newHTML );
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With