1.

```
<div id="test"></div>
<script type="text/javascript">
//operate document.getElementById('test')
</script>

```

2.

```
<div id="test"></div>
<script type="text/javascript">
window.onload = function()
{
  //operate document.getElementById('test')
};
</script>

```

Can we ensure that document.getElementById('test') exists just by putting javascript below it?