Am I Referencing the jQuery Object or a DOM Element?
Even when you have a basic understanding of when the this keyword points to a DOM element or to a jQuery object, the concept can still be confusing once you save the value of this to a variable....
View ArticleWrite your own selectors
jQuery has loads of built-in selectors for selecting elements by ID, class, tag, attribute and many more. But what do you do when you need to select elements based upon something else and jQuery...
View ArticleUse IDs instead of classes wherever possible
jQuery makes selecting DOM elements using classes as easy as selecting elements by ID used to be, so it’s tempting to use classes much more liberally than before. It’s still much better to select by ID...
View ArticleUsing chaining properly
One of the coolest things about jQuery is it’s ability to chain method calls together. So, for example, if you want to switch the class on an element. $('myDiv').removeClass('off').addClass('on'); If...
View ArticleThe 30 CSS Selectors you Must Memorize
1. * * { margin: 0; padding: 0; } Let’s knock the obvious ones out, for the beginners, before we move onto the more advanced selectors. The star symbol will target every single element on the page....
View Article