jQuery Selectors



When I run the code, I get the following alert message: [object Object]

Using jQuery I have selected the class skillset. But why do the words 'object Object' appear in the alert message. Should not I be getting a message which includes the class name skillset?

function main(){
  var $skillset=$('.skillset');


When you use alert() the browser will return the type. What are you trying to get?


Skillset is a class, not an object. So the alert message should say 'Class'. Is this correct?


Jquery is a subsidiary of Javascript which uses standard OOP rules which in this case, treats skillset as an object.


Ok, Thanks for that! :slight_smile: But, why does the word Object appear twice?


Just as a means of reference.


This topic was automatically closed after 7 days. New replies are no longer allowed.