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
Comments
Post a Comment