dangrossman/bootstrap-daterangepicker — pull request #290 by jakswa (2014-04-08 06:27:57+00:00)
Title: fix corrupt child nodes in IE9 and below

In IE9 and below, using `.html()` by itself to remove/update DOM structure will apparently break the removed child nodes to the point that things like `.closest()` no longer return any parent elements. This was resulting the `outerClick()` incorrectly hiding the datepicker for various cases. I'm just calling `.empty()` beforehand. The behavior is now corrected in my tests on IE9.

The [jQuery docs](https://api.jquery.com/html/#html2) say:
> In Internet Explorer up to and including version 9, setting the text content of an HTML element may corrupt the text nodes of its children that are being removed from the document as a result of the operation. If you are keeping references to these DOM elements and need them to be unchanged, use `.empty().html( string )` instead of `.html(string)` so that the elements are removed from the document before the new string is assigned to the element.

See https://github.com/dangrossman/bootstrap-daterangepicker/issues/275 for related discussion.