I am able to create div tag dynamically but unable to create form tag dynamically. the task is I have to create form tag in that i have to create div tag dynamically. Below is the code that create div tag dynamically
var divTag = document.createElement("div");
document.body.appendChild(divTag).innerHTML = data;
Please help me to create form tag in that div tag dynamically using javascript
I don’t know, what kind of data you assign to
innerHTML, but the above code would append theformtag after that data.Alternativly you could build up a whole string with all the content for that
divand setinnerHTMLonce.