Side navigation
#3621 closed bug (invalid)
Opened November 18, 2008 05:13PM UTC
Closed November 19, 2008 10:33PM UTC
Plus Sign in Element ID, Element Reference Issue
Reported by: | andrew_ | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.3 |
Component: | docs | Version: | 1.2.6 |
Keywords: | plus sign element id | Cc: | |
Blocked by: | Blocking: |
Description
If an element has a plus sign (+) in it's ID, $('#..') does not return any references to the element. document.getElementById, however, is able to.
Using the following html, I have been able to reproduce the issue;
<html>
<body><div id="_f1+1"/>
<script type="text/javascript">
alert($("#_f1+1").length);
alert(document.getElementById("_f+1"));
</script>
</body></html>
Attachments (0)
Change History (2)
Changed November 18, 2008 05:22PM UTC by comment:1
Changed November 19, 2008 10:33PM UTC by comment:2
component: | core → docs |
---|---|
resolution: | → invalid |
status: | new → closed |
Ok... it's basically all those character that have a special meaning in selectors.
They're also invalid characters for IDs, even though browsers do retrieve the element.
If you think this is needed, ask on jQuery's google group.
http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_that_has_weird_characters_in_its_ID.3F
Lists the solution for this, however, the FAQ doesnt make mention of what symbols should be escaped. Perhaps the docs could use an update in that regard.