0

Possible Duplicate:
Jquery multiple selectors with this

Is it possible to use multiple selectors with $(this)? I tried:

$('#helper').click(function() {
$(this + " #divname").html());
});

But it never works. I just want to make sure its selecting the div within the div that was clicked on.

2
  • 3
    Btw IDs are supposed to be unique, so if you have multiple elements with the ID divname, then you are doing something wrong. Commented Oct 15, 2011 at 7:22
  • Your code makes no sense. What is the statement in the function supposed to achieve? Also, why would you need $(this) in this case? You already know "helper" was clicked. Finally, you can always use $(this).children("#divname") or .find() - depending on your DOM Commented Oct 15, 2011 at 7:26

1 Answer 1

1

if you are trying to look for a child of this you can do it like

$('#helper').click(function() {
$(" #divname",this ).html());
});
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.