PDA

View Full Version : event argument not passing.


ghostz00
07-16-2008, 05:18 PM
I'm stumped, I have a table with onclick event's set on the table cells and on top of that I have a div inside of them also set with an onclick. I can't get the event object to pass through to my function.

Firebug gives me a syntax error with this code.

<div onclick="function (e){ myFunc(e,'msg'); }">msg</div>

The msg string gets printed from a php variable.

if I just use myFunc(e,'msg'), firebug says e is not defined.

any thoughts?

ghostz00
07-16-2008, 07:01 PM
fixed with:

<div onclick="myFunc(event,'msg');">msg</div>