What I recommend is that you execute the function that will be responsible for creating your elements {opciones}
once the document is ready , I'll give you the example based on your code and using a little jQuery :
EDIT : As you told me you can not use jQuery here I leave you a
example with pure JavaScript :
function cargar() {
var provincias = ["Cantabria", "Asturias", "Galicia", "Andalucia", "Extremadura"]; //Tu array de provincias
var select = document.getElementById("provincias"); //Seleccionamos el select
for(var i=0; i < provincias.length; i++){
var option = document.createElement("option"); //Creamos la opcion
option.innerHTML = provincias[i]; //Metemos el texto en la opción
select.appendChild(option); //Metemos la opción en el select
}
}
cargar();
<select id="provincias"></select>
The example using jQuery:
HTML :
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<select id="provincias"></select>
JavaScript + jQuery :
$(document).ready(function() {
var provincias = ["Cantabria", "Asturias", "Galicia", "Andalucia", "Extremadura"];
for(var i=0; i < provincias.length; i++){
var option = document.createElement("option"); //Creas el elemento opción
$(option).html(provincias[i]); //Escribes en él el nombre de la provincia
$(option).appendTo("#provincias"); //Lo metes en el select con id provincias
}
});
I hope it helps you:)