Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selectors on document fragment #284

Closed
Munawwar opened this issue Sep 12, 2014 · 1 comment
Closed

Selectors on document fragment #284

Munawwar opened this issue Sep 12, 2014 · 1 comment
Milestone

Comments

@Munawwar
Copy link

A simple selector such as the following doesn't seem to work:

var df = document.createDocumentFragment(),
    div = document.createElement('div');
div.className = 'btn';
df.appendChild(div);

Sizzle('.btn', df).length; //is 0
df.querySelectorAll('.btn').length; //is 1

I used dist/sizzle.min.js from latest commit (a9361f6) to test the above.

@Munawwar
Copy link
Author

If you are wondering the use case for this feature: For unit testing HTML output. - I could get rid of code like this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants