Difference between $(this) and this keyword in jQuery?

$(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 […]

Difference between ID selector and class selector in jQuery?

The difference between ID and class selector, It is same with jQuery. ID selector uses ID e.g. #element-id to select element, while class selector uses CSS class to select elements. When you just need to select only one element, use ID selector, while if you want to select a group of element, having same CSS […]