You can access the arguments passed to a function via the arguments
property. That should work:

function showIt() {
    otherFunction.apply(null, $.makeArray(arguments));
}

That way you don't even have to specify the arguments explicitly and
could have variable arguments length. arguments is an array like
object, thus you can acess a single arguments via index:

function showIt() {
    alert('First argument: ' + arguments[0]);
}


--Klaus




On 10 Okt., 06:55, GARIL <[EMAIL PROTECTED]> wrote:
> <div id="h1">
>   <a href="" onClick="showIt(first,second,third);">Click me</a>
> </div>
>
> Is it possible to grab the first,second,third parameters of the showIt
> function above so that I can pass the same parameters to another
> function?
>
> I managed to get the event itself using:
>     $("div.hitarea").next().attr("onclick")
>
> but I don't know how to continue...

Reply via email to