Opened 11 years ago
Closed 11 years ago
#10389 closed bug (invalid)
Selector by pattern in parents
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | 1.next |
Component: | selector | Version: | 1.7b1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Selecting elements by patteren as $(this).parents("div[ @id = 'tc-' ]") not working in jqeury version 1.6.4 but it worked in jquery 1.2.3b.
The below code can be tested:
<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<head>
<title>jQuery Attribute Predicate Demo</title> <script type="text/javascript" src="lib/jquery.js"></script> <script>
$(document).ready(function(){
$('#start').click(function(){
p = $(this).parents("div[ @id = 'tc-' ]"); $("#print").html(p.attr('id'));
});
});
</script>
</head> <body>
<div id="tc-2">111
<div>222
<div>3333</div> <div id="start" style="color: red;">Press me</div>
</div>
</div>
<div id="print"></div>
</body>
</html>
Change History (3)
comment:1 Changed 11 years ago by
Component: | unfiled → selector |
---|---|
Milestone: | None → 1.next |
Owner: | set to [email protected]… |
Status: | new → pending |
Version: | 1.6.4 → 1.7b1 |
comment:2 Changed 11 years ago by
Status: | pending → new |
---|
I have saved the code in http://jsfiddle.net/5YZST/ But in local test the code works in jquery version 1.2 but not works in ver.: 1.6.
In jsfiddle.net in both version of jquery is not working!
comment:3 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
This is a question for the forum, not the bug tracker. Remove the @
.
Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket!
Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.