How to Add DOM Elements Via jQuery The following script and fiddle demonstrate how to add the DOM elements via the jQuery library $(document).ready(function() { var el = $(" ").attr({ "type": "checkbox", "class": "select", "value": "hi" }); var lbl = $(" ").text("hi"); $(".op").append(el); $(".op").append(lbl); console.log(el); }); To play around, the fiddle is here -- Saravanan
I have 11+ years of experience in Software development. I am proud to be in the top 5 Multi-Tenancy answerers @ Stackoverflow. I have worked with C#, Java, MySQL, SQL Server, Multi-tenancy, AWS, Azure, Terraforms, Java with Spring boot and Python, groovy, bat scripts