4

What the instance init in browser console mean ?

If anyone has any idea on how to deal with this problem, I would really appreciate it.

Here is an attachment of the code that I have while I was doing a console.log

init [input#TreatmentDefault, context: document, selector: "#TreatmentDefault"]

I am trying to access the first iteration [0] of an object which saves some data but I am not able to do so. You can see on the screen capture which I created that there is an init instance at the beginning and then you have the first iteration starting at [0]. I want to be able to take that part and print it so I can be able to access the rest of the data separately.

Thanks

Oris Sin
  • 1,023
  • 1
  • 13
  • 33
  • 2
    What exactly is the object being logged? I assume it's a jQuery object. If so `init()` is jQuery's internal constructor: https://j11y.io/jquery/#v=1.11.2&fn=jQuery.fn.init. Why do you feel that you need to do anything with this? If you could explain your goal here we may be able to offer some more useful help, as right now it's not clear what you're trying to do. – Rory McCrossan Mar 29 '19 at 11:16
  • *"how to deal with this problem"* - ignore it? What's the actual *problem* here? – freedomn-m Mar 29 '19 at 11:18

1 Answers1

2

Most likely the page you're applying the $() function to includes jQuery, so you're actually calling the jQuery's function, not the Chrome's built-in one.

See this answer in a relevant thread:

However, these values are only the default values in the console. If the page overwrites the variable by including something like jQuery, the console will use the value from the page itself, and something like $('p') will return a jQuery object rather than just the first p element.

mstone
  • 414
  • 4
  • 11