Q:

Function that call input type text - Javascript / PHP

i'm creating a form page where i 'ill put some inputs to my customers fill it. 
but , every time i must write for example > 
<input type="number" class="form-control" name="quantidade" required max="900" />

for example , but i see a friend that was using javascript function to call theses input , so when he want insert a input like this , he just call on your index.page . 
someone could help ?  
i have tryed this . 
<script type="text/javascript">
  function add() {
    document.getElementById("inputnumber").innerHTML = '<input type="number" class="form-control" name="quantidade" required max="900" />';
  }
</script>

with this index.page
<div class="row">
    <div class="col-md-12">
        <div class="row">
            <div class="col-md-6">
                <form role="form">
                    <div class="form-group" id="inputnumber">
                    </div>
                    <div class="form-group">
                    </div>
                    <button type="submit" class="btn btn-default">
                        Submit
                    </button>
                </form>
            </div>
            <div class="col-md-6">
            </div>
        </div>
    </div>
</div>

A:

So easy, u need this function, look:
function callInput(a,b,c) {
    var x = document.createElement('input');
    x.className = 'form-control';
    x.type = b;
    x.name = c;
    a.appendChild(x);
}

How to use, look:
callInput(parentElemen,'type','name');

Example:
callInput(document.getElementsByTagName('form')[0],'submit','quantidade');

Good luck.