1

console.log(this) throws:

Object
    eles: Object
        container: x.fn.x.init[1]
        ele: x.fn.x.init[1]
        0: div.cropMain
        context: document
        length: 1
        prevObject: x.fn.x.init[1]
        selector: ".two .cropMain"
        __proto__: Object[0]
        img: x.fn.x.init[1]

How can I grab the selector value: ".two .cropMain"?

2
  • 1
    jquery object do have a property named selector. If you get undefined if for some other reason. Could you show your code? Commented Aug 9, 2013 at 1:35
  • @Chaplin couuld you post the entire function in which you do console.log(this); Commented Aug 9, 2013 at 1:39

1 Answer 1

4

You can access it like this:

this.eles.selector
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.