Question: I want to create a Jquery script that scrolls down to the next div down below, whenever user clicks. 

I have an array of pixel offsets of each DIV from the top.  

I dont' know how to loop or 
count the number of clicks. 

```
jQuery(document).ready(function(){
    var move=[0,642,1725,2393,3036,6097,6991];
    var i=0;
    var duration = 500;

    jQuery(".next").click(function(){
        //event.preventDefault();

        jQuery('html, body').animate({scrollTop: move[i]+'px'}, duration);   
    })      
});

```

Answer: 
try using this:

```
<button type="submit" name="button" value="@Model.Sites[i].Id">Select</button>

```
the timing will be a little tricky but you can try this

```
<input type="submit" value="Select" class="btnSubmit1" />

```

then in your script set a hidden field based on the button click

```
$(document).ready(function(){
    $('.btnSubmit1').on('click', function(){
        $('.hdnButton').val('btnSubmit1');
    });
});

```

If the form submits before the field is set then you may need to change the button type to button, set the field and submit the form via ajax [Submit a form using jQuery](https://stackoverflow.com/questions/1200266/submit-a-form-using-jquery)