Like this:
if (!jQuery.contains(document, $foo[0])) {
//Element is detached
}
This will still work if one of the element’s parents was removed (in which case the element itself will still have a parent).
More Related Contents:
- How to change color of SVG image using CSS (jQuery SVG image replacement)?
- jQuery Ajax error handling, show custom exception messages
- Fancybox links don’t show in lightbox – what am i missing?
- Clear form fields with jQuery
- Jquery $.ajax fails in IE on cross domain calls
- Catch error if iframe src fails to load . Error :-“Refused to display ‘http://www.google.co.in/’ in a frame..”
- JQuery Event Handlers – What’s the “Best” method
- Submitting HTML form using Jquery AJAX
- jqGrid custom format fails on addClass
- Can I load external stylesheets on request?
- how to store an array in jquery cookie?
- How can I change the text color with jQuery?
- What’s the difference between jQuery .val() and .attr(‘value’)?
- AJAX jQuery.load versus jQuery.get
- angular.element vs document.getElementById or jQuery selector with spin (busy) control
- Getting text within element excluding decendants
- Datatables – Search Box outside datatable
- Auto-click button element on page load using jQuery
- Creating a json object in jsp and using it with JQuery
- Trigger click on select box on hover
- How to merge cells in jqGrid 4.0
- What is the difference between XMLHttpRequest, jQuery.ajax, jQuery.post, jQuery.get
- jquery disable submit button on form submission
- jQuery draggable + droppable: how to snap dropped element to dropped-on element
- jQuery code doesn’t work if I’m using a local jquery.js file, why?
- Edit datatable in shiny with dropdown selection (for DT v0.19)
- How to refresh the src of with jQuery?
- The .fadeOut() method to use visibility property instead of display property
- My Own Like Button: Django + Ajax — How?
- Getting Zend_Navigation menu to work with jQuery’s Fisheye