If we want to create a button in HTML , we need a code similar to:
<input type="submit" value="Numero parrafos" id="num_parrafos" name="Numero Parrafos"/>
How would the code be moved to jQuery or Javascript? To avoid the need to modify the HTML code. Simply create it from an external .js file that will be called in the head of the HTML between the <script>...</script>
Javascript code: Is the creation correct?
var boton = document.createElement("button");
boton.type = "button";
document.body.appendChild(boton);
What if we have the button inside a global tag <form>
when a form should be: " document.body.form.appendChild(boton)
" or should we always refer to the body with " document.body.appendChild(boton)
"?