jquery: Bug of find element with empty attribute in v3.4
Description
Hi. After updating jQuery to 3.4, I encountered strange behavior on Edge and IE11.
Finding elements with empty attributes was successful in v3.3. But, v3.4 and later will fail on Edge and IE11.
<div id="test">
<input name="">
</div>
var $input = $("#test").find("[name='']");
console.log($input.length); // This will return 0, only on Edge and IE11 after updating to v3.4
Link to test case
https://jsbin.com/jitatiduqi/1/edit?html,css,js,output
If this is a bug, I’m glad if a fix is considered. Thanks.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (13 by maintainers)
Commits related to this issue
- Selector: Make empty attribute selectors work in IE 11/Edge again qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Assigning a tempora... — committed to mgol/jquery by mgol 5 years ago
- Selector: Make empty attribute selectors work in IE 11/Edge again qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Assigning a tempora... — committed to mgol/sizzle by mgol 5 years ago
- Selector: Make empty attribute selectors work in IE 11/Edge again qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Assigning a tempora... — committed to mgol/sizzle by mgol 5 years ago
- Selector: Make empty attribute selectors work in IE 11/Edge again qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Assigning a tempora... — committed to mgol/sizzle by mgol 5 years ago
- Selector: Make empty attribute selectors work in IE 11/Edge again qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Detect that & fall ... — committed to mgol/sizzle by mgol 5 years ago
- Selector: Make empty attribute selectors work in IE 11/Edge again qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Detect that & fall ... — committed to mgol/sizzle by mgol 5 years ago
- Selector: Make empty attribute selectors work in IE 11/Edge again qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Detect that & fall ... — committed to mgol/sizzle by mgol 5 years ago
- Selector: Make empty attribute selectors work in IE 11/Edge again qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Detect that & fall ... — committed to mgol/jquery by mgol 5 years ago
- Selector: Make empty attribute selectors work in IE 11/Edge again qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Detect that & fall ... — committed to mgol/sizzle by mgol 5 years ago
- Selector: Make empty attribute selectors work in IE 11/Edge again qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Detect that & fall... — committed to jquery/sizzle by mgol 5 years ago
- Selector: Make empty attribute selectors work in IE 11/Edge again qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Detect that & fall ... — committed to mgol/jquery by mgol 5 years ago
- Selector: Make empty attribute selectors work in IE 11/Edge again qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Detect that & fall ... — committed to mgol/jquery by mgol 5 years ago
- Selector: Make empty attribute selectors work in IE 11/Edge again qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Detect that & fall ... — committed to mgol/jquery by mgol 5 years ago
- Selector: Make empty attribute selectors work in IE 11/Edge again qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Detect that & fall ... — committed to mgol/jquery by mgol 5 years ago
- Selector: Make empty attribute selectors work in IE 11/Edge again qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Detect that & fall ... — committed to mgol/jquery by mgol 5 years ago
- Selector: Make empty attribute selectors work in IE 11/Edge again qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Detect that & fall ... — committed to mgol/jquery by mgol 5 years ago
- Selector: Make empty attribute selectors work in IE again qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Detect that & fall back to... — committed to jquery/jquery by mgol 5 years ago
- Selector: Update Sizzle from 2.3.4 to 2.3.5 Fixes gh-4424 Fixes gh-4435 Fixes gh-4441 Fixes gh-4453 — committed to mgol/jquery by mgol 4 years ago
- Selector: Update Sizzle from 2.3.4 to 2.3.5 Fixes gh-4424 Fixes gh-4435 Fixes gh-4441 Fixes gh-4453 Closes gh-4641 — committed to jquery/jquery by mgol 4 years ago
- Selector: Make empty attribute selectors work in IE again qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Detect that & fall back to ... — committed to mgol/jquery by mgol 2 years ago
Sizzle update merged in #4641. The issue is now fixed both on
master
& on3.x-stable
.~~Sizzle PR: https://github.com/jquery/sizzle/pull/450~~
EDIT: This wasn’t a PR for this issue.