Interviewer And Interviewee Guide

Web Development Ninjas Interview Question:

Please explain difference between $(this) and this keyword in jQuery?

Submitted by: Muhammad
This could be a tricky question for many jQuery beginners, but indeed it's a simple one. $(this) returns a jQuery object, on which you can call several jQuery methods e.g. text() to retrieve text, val() to retrieve value etc, while this represent current element, and it's one of the JavaScript keyword to denote current DOM element in a context. You can not call jQuery method on this, until it's wrapped using $() function i.e. $(this).
Submitted by: Muhammad

Read Online Web Development Ninjas Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.