Side navigation
#15109 closed bug (notabug)
Opened May 27, 2014 03:32AM UTC
Closed May 28, 2014 02:57PM UTC
bug about Attribute Equals Selector [name="value"]
| Reported by: | wxpxzdj | Owned by: | wxpxzdj |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.11.1 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
in jquery 1.11.1
[[Image(http://v1.freep.cn/3tb_14052711285208qr512293.jpg)]]
[[Image(http://v1.freep.cn/3tb_140527112855ndav512293.jpg)]]
in jquery 1.8.3
[[Image(http://v2.freep.cn/3tb_140527112857nsen512293.png)]]
[[Image(http://v2.freep.cn/3tb_140527112900v2g2512293.jpg)]]
Attachments (0)
Change History (5)
Changed May 27, 2014 04:02AM UTC by comment:1
| owner: | → wxpxzdj |
|---|---|
| status: | new → pending |
Changed May 27, 2014 04:08AM UTC by comment:2
| status: | pending → new |
|---|
jquery 1.11.1
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="http://code.jquery.com/jquery-1.11.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$("#btn").click(function () {
$("#number").text($("input[name='code'][value='1']").length);
$("input[name='code'][value='1']").css("background", "#FF6633");
return false;
});
});
</script>
</head>
<body>
<form id="form1">
<div>
<input type="text" name="code" value="1" /><br/>
<input type="text" name="code" value="1" /><br/>
<input type="text" name="code" value="" /><br/>
<input type="text" name="code" value="" /><br/>
<input type="button" value="find the 1" id="btn" /><br/>
find:<label id="number"></label>
</div>
</form>
</body>
</html>
jquery 1.8.1
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="http://code.jquery.com/jquery-1.8.3.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$("#btn").click(function () {
$("#number").text($("input[name='code'][value='1']").length);
$("input[name='code'][value='1']").css("background", "#FF6633");
return false;
});
});
</script>
</head>
<body>
<form id="form1">
<div>
<input type="text" name="code" value="1" /><br/>
<input type="text" name="code" value="1" /><br/>
<input type="text" name="code" value="" /><br/>
<input type="text" name="code" value="" /><br/>
<input type="button" value="find the 1" id="btn" /><br/>
find:<label id="number"></label>
</div>
</form>
</body>
</html>
Changed May 27, 2014 04:14AM UTC by comment:3
| status: | new → pending |
|---|
No, you need to put this code into a fiddle on jsfiddle and post the link back here.
Changed May 27, 2014 05:00AM UTC by comment:4
| _comment0: | http://jsfiddle.net/BqPs5/2/ \ [[BR]] \ (PS:I'm sorry......) → 1401167943979017 |
|---|---|
| status: | pending → new |
(PS:I'm sorry......)
Changed May 28, 2014 02:57PM UTC by comment:5
| resolution: | → notabug |
|---|---|
| status: | new → closed |
This is working exactly as expected. [value='1'] selects elements with a "value" ''attribute'' equal to 1, regardless of the current "value" ''property'' (e.g., as set by .val or .prop).
Please provide a test case using jsFiddle, as described on http://bugs.jquery.com