well I have a new problem that I can't solve and that is that I try to have a form with a button inside that will increase the number of sales but being a button it does what the form asks for which is an action but I don't want to send it yet but to have another button than this if I sent the information, I attach code:
<form method="post" role="form" action="monitoreo_x_region.php">
<input type='button' name="ventas" id="aumentar" value="0" onclick="aumentar()">
<script>
var inicio = 0; //se inicializa una variable en 0
function aumentar(){ // se crean la funcion y se agrega al evento onclick en en la etiqueta button con id aumentar
var cantidad = document.getElementById("aumentar").value = ++inicio; //se obtiene el valor del input, y se incrementa en 1 el valor que tenga.
}
</script>
<button type="submit" id="botonop" class="btn btn-primary"><i class="fa fa-check-circle"></i> Agregar ventas</button>
</form>
Here is the solution friend, and try when you go to work with the DOM, always load the script at the end or enter the code inside this event to load once the page has loaded the HTML document,