dimanche 7 juillet 2019

How to make placeholder for the select option but it has loop value?

I've done the loops of the select option , but i had to make the place holder

What i'm trying to say is that it has the placeholder in the first value of select, the next value is the value that i loop

the code i've been made

var start = 2010;
var end = 2030;
var options = "";
for (var year = start; year <= end; year++) {
  options += "<option>" + year + "</option>";
}
document.getElementById("idBulanBerlaku").innerHTML = options;
<div class="form-group">
  <div class="col-sm-12">
    <select class="form-control" id="idBulanBerlaku">
      <option value="" disabled selected hidden>Please Choose...</option>
    </select>
  </div>
</div>



Aucun commentaire:

Enregistrer un commentaire