Actually, I have this select field to select the option which initially contains data "1".But if click on Add button then "2" should be added to the select field dynamically. I have tried but at first stage,2 is added but later on, it doesn't increase to 3,4,5.I just get 2,2,2,2.

```
<html>
<body>

<form>
  <select id="mySelect" size="1">
    <option id="option1">1</option>

  </select>
</form>
<br>

<button type="button" onclick="myFunction()">Add</button>

<script>

function myFunction() {

     var y = document.getElementById("option1").value;

    var x = document.getElementById("mySelect");
    var option = document.createElement("option");
    option.text = ++y;
    x.add(option);
}
</script>

</body>
</html>

```