scrollIntoView possible onload?

Is it possible to use scrollIntoView onload? I know how to use it onclick, but I can not find out how to use it onload. Is it possible? And if it is, what would be the correct syntax?

<script>
function showIt(elID)
{
var el = document.getElementById(elID);
el.scrollIntoView(true);
}
</script>

<input type=“button” value=“Show para” onclick=“showIt(‘pToShow’);” />

I need to use it inside form action which doesn’t work in ie8. Also I need to use this if user came to site from other site as first visit.

An easier way (non-javascript too) would just to put a hash in your url.

<a href="http://www.yourdomain.com#elID">This link will scroll page to elID</a>

elID of course being the id of the element that you want your page to automatically scroll to.

Use the onload event of the body:

<head>
<script>
function showIt(elID)
{
var el = document.getElementById(elID);
el.scrollIntoView(true);
}
</script>
</head>
<body onload=“showIt (‘pToShow’)”>
</body>

In case of form submit, use the onsubmit event.
I think the following links will help you:
onload,
onsubmit