Lets take an anchor tag with an onclick event, that calls a Javascript function.
<a href="#" onClick="showDiv(1);">1</a>
Now in javascript write the below code
function showDiv(pageid)
{
alert(pageid);
}
This will show you an alert of "1"....