Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
fadeToggle() with siblings() selector returns the entire script to the DOM #4179
Using fadeToggle() with the siblings() selector returns the text of the entire function on the DOM.
This issue arose in a class where I was teaching jQuery. We reverted to an older version, and the problem goes away. I've replicated the issue in JSFiddle.
Link to test case
We looked this over in the meeting and noticed that this is indeed working as expected. The appearance of script text can be confusing, but there is in fact a sibling script element in the fiddle (next to the divs). Script elements are not visible by default, obviously, but can be animated like other elements. There are use cases for this, such as in demos or documentation, so it's not something we want to disable.
This particular case can be fixed by adding a selector to siblings.