Javascript examples for Function:Function Argument
Handle Reference error
<html lang="en"> <body> <span id="counter" onclick="test(this.id)">1,234,567.15</span> <script> function test(event) {/*w ww .ja va 2 s.c o m*/ console.log(arguments[0]); console.log(event);//counter,because you pass id 'counter' ,you didn't pass event } </script> </body> </html>