In an HTML document, the document.createElement() method creates the HTML element specified by tagName, or an HTMLUnknownElement if tagName isn't recognized.
var element = document.createElement(tagName[, options]);
tagName
A string that specifies the type of element to be created. The nodeName of the created element is initialized with the value of tagName. Don't use qualified names (like "html:a") with this method. When called on an HTML document, createElement() converts tagName to lower case before creating the element. In Firefox, Opera, and Chrome, createElement(null) works like createElement("null").
options(Optional)
An optional ElementCreationOptions object containing a single property named is, whose value is the tag name for a custom element previously defined using customElements.define()
. See Web component example for more details.
DEMO
var btn = document.createElement("BUTTON"); // Create a <button> element
var t = document.createTextNode("CLICK ME"); // Create a text node
btn.appendChild(t); // Append the text to <button>
btn.onclick=function(e){
alert('You have clicked me..');
}
document.body.appendChild(btn); // Append <button> to <body>
"+ teams[i]['Associate_Name']+"
"; } $('#ulist').html(listItems); – Vivek Kumar Apr 04 '18 at 11:55"+ teams[i]['member_id']+"More