What does [object Object] mean?

后端 未结 10 2029
醉酒成梦
醉酒成梦 2020-11-22 03:22

I am trying to alert a returned value from a function and I get this in the alert:

[object Object]  

Here is the JavaScript code:



        
10条回答
  •  灰色年华
    2020-11-22 04:15

    You have a javascript object

    $1 and $2 are jquery objects, maybe use alert($1.text()); to get text or alert($1.attr('id'); etc...

    you have to treat $1 and $2 like jQuery objects.

提交回复
热议问题