I am doing my javascript assignment in which I have a form and there are multiple buttons in it. I want that javascript should render like
<form>
<input />
<button />
</form>
but it is rendering like this
<form> </form>
<input />
<button />
sample code
var formTag = document.createElement('form');
document.body.appendChild(formTag);
var txtInput = document.createElement("input");
var txtNode = document.createTextNode("0");
txtInput.setAttribute("id", "txtInput");
txtInput.appendChild(txtNode);
document.form.appendChild(txtInput);