For the record, jQuery has an is()
function for this:
a.is(b)
Note that a
is already a jQuery instance.
More Related Contents:
- How do I check if an element is hidden in jQuery?
- How do I select text nodes with jQuery?
- Check if an image is loaded (no errors) with jQuery
- Get selected text from a drop-down list (select box) using jQuery
- Detect element content changes with jQuery
- How can I select an element by name with jQuery?
- How to hide a in a menu with CSS?
- jQuery object and DOM element
- Find DOM element by ID when ID contains square brackets?
- How to get the element clicked (for the whole document)?
- Is there a DOM event that fires when an HTML select element is closed?
- AngularJS: How to run additional code after AngularJS has rendered a template?
- Is there any “on DOM change” event? [duplicate]
- How do I monitor the DOM for changes?
- change html text from link with jquery
- Jquery Event Not Triggering for DOM Elements Created after page load [duplicate]
- Converting a recursive function into an asynchronous CPS implementation (javascript)
- How to dynamic filter options of with jQuery?
- jQuery/Javascript – How to wait for manipulated DOM to update before proceeding with function
- Why do multiple `.appendTo` calls on a newly created jQuery element only append it once?
- DOM Mutation event in JQuery or vanilla Javascript
- Uncaught TypeError: Cannot read property ‘top’ of undefined
- How to remove DOM elements without memory leaks?
- How can I get access to a Highcharts chart through a DOM-Container?
- How can I remove wrapper (parent element) without removing the child?
- Unloading/Removing content from an iFrame
- jQuery difference between :eq() and :nth-child()
- What’s the difference between a jQuery object and a DOM element? Difference between .get() and .index()?
- In web browsers, what’s the difference between onblur and onfocusout?
- Create a table in SVG