jQuery this selector function and limitations

0 votes

I need help understanding $(this). Is it possible to narrow the focus of "this" within the parentheses or does "this" preclude the use of any other attributes?

For example: I don't understand why this code:

$(this).children("div")

can't be rewritten like this:

$(this + " div")

without having to resort to something like:

$('#'+$(this).attr("id")+ " div")

Also, can you point me to 'this' in the jQuery documentation? It is difficult to use 'this' as a search term for obvious reasons.

4 days ago in Web Development by gaurav
• 12,820 points
5 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Web Development

0 votes
0 answers

TypeError: this.client.incrementMaxListeners is not a function

I'm making a command for my discord ...READ MORE

Dec 29, 2020 in Web Development by anonymous
• 120 points
292 views
0 votes
1 answer

$("#select option:second").val() jquery - keep select second value of select box option

Yes, you want the special jQuery eq() selector. ...READ MORE

answered 5 days ago in Web Development by rajatha
• 3,540 points
5 views
0 votes
1 answer

Jquery and Menu and logo

Seems your anchor tag is not visible ...READ MORE

answered 5 days ago in Web Development by rajatha
• 3,540 points
5 views
0 votes
0 answers

how to use substr() function in jquery?

how to use substr function in this ...READ MORE

4 days ago in Web Development by gaurav
• 12,820 points
1 view
0 votes
0 answers

What is the difference between JavaScript and jQuery?

What is the main difference between JavaScript ...READ MORE

4 days ago in Web Development by gaurav
• 12,820 points
2 views
0 votes
0 answers

jQuery find, each, children and accessing sub-children

I've been getting a bit frustrated with ...READ MORE

8 hours ago in Web Development by gaurav
• 12,820 points
5 views
0 votes
1 answer

How do I select a sibling element using jQuery?

Use jQuery . siblings() to select the matching ...READ MORE

answered Jun 6 in JQuery by Edureka
• 13,600 points
19 views
0 votes
1 answer

How do I select a sibling element using jQuery?

jQuery siblings() Method The siblings() method returns all ...READ MORE

answered Jun 7 in JQuery by Edureka
• 13,600 points
14 views
0 votes
1 answer

How to use jquery with asp.net ajax?

If you weren't aware, Microsoft is planning ...READ MORE

answered Oct 15, 2018 in IoT (Internet of Things) by Annie97
• 2,160 points
172 views
0 votes
1 answer

Is 'sparkline' a method?

I suggest you to check 2 things That jquery.sparkline.js is actually ...READ MORE

answered Nov 9, 2018 in Apache Spark by Frankie
• 9,830 points
572 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP