jQuery Tutorials

Let's Sharpen Your jQuery Skills

  1. How to Get HTML Elements' Text Excluding Children Using jQuery and JavaScript?

    If you're in need of retrieving text from an element but want to ignore text from all (or even some) child elements, then check out this article to see a list of techniques and methods you can use. We've also highlighted why and when a particular method is more useful than the other.
  2. How to Check If an Element Has Attribute Using jQuery and JavaScript?

    With the absence of a hasAttr() method in jQuery it may be difficult for some to check for an attribute's existence on an HTML element. To add to the frustration, commonly used techniques such as double negation, may actually yield unexpected results in certain cases. It is for that reason we've compiled a list of ways to properly check the existence of an attribute on an HTML element using jQuery and JavaScript.
  3. How to Determine the Scroll Direction Using jQuery?

    Want to know the direction in which the user is scrolling, both vertically and horizontally, using jQuery? Check out our nifty code snippet that you can easily plug into your existing code. What's even better is that you can easily specify any element selector, other than the browser window, to apply the same detection code to any HTML element on the web page.
  4. How to Check if an Element Is Visible or Hidden in jQuery?

    The answer depends largely on how we define visibility of an element. For example: is an off-screen element considered visible? Is an element with zero opacity or CSS property visibility: hidden considered visible? In this article we'll look at all these different interpretations and related code to test element visibility.