I want to automate this [page](https://adarshpk.github.io/) to generate exam results. I want to generate exam results from one particular date to some other particular date. On clicking the submit button, the page generates another page in a new tab.

Manually clicking 10 times will generate 10 tabs. But see the following code:

```
for(let i=0;i<10;i++)
{
document.querySelector('#reg1').click();
console.log(`clicked ${i}th time`)
}

```

I want to trigger a click 10 times and it should generate 10 tabs accordingly. But the problem is that the click works only works on the 10th iteration and spawns 1 tab only. Help me.
[see](https://i.stack.imgur.com/PRY4u.jpg)

**Edit:**
@Jesse
See my utility full code:

```
var dateFrom=new Date('2017-01')
var dateTo=new Date('2019-01')
for(var i=dateFrom;i<dateTo;i.setMonth(i.getMonth()+1))
{
    // console.log(`${i.getFullYear()}-${i.getMonth()}`);
    // var dd=`${i.getFullYear()}-${i.getMonth()}`;
    var dd=new Date(i).toISOString().substr(0,7);
    console.log(dd);
    document.querySelector("input#picker.form-control").value=dd;
    var type='Supplementary'
    document.querySelector("select#result_type.form-control.form-email.selectoption").value=type;
    document.querySelector('#reg1').click();

}

```