Question: There I have a button that is hidden from the user but want it to be clicked by default like with a check box if you want it to be checked by default you add the checked attribute is there any way you could do the same thing with a button here is my code

```
<input id="submit" type="hidden" value="Reverse Geocode" autofocus> 

```

Answer: 
You can do as following:

```
<script type="text/javascript">
document.getElementById("submit").click();
</script>

```
May be you can do the following:

```js
document.getElementById('chkTest').addEventListener('click', function(){
  if(this.checked)
    document.getElementById('submit').click();
});

document.getElementById('submit').addEventListener('click', function(){
  alert('button clicked');
});
```

```html
<input id="submit" type="hidden" value="Reverse Geocode" autofocus />

<input type="checkbox" id="chkTest" /> Check To Click The Button
```