#6392 closed enhancement (wontfix)
$('DIV#myId').attr('for') - im can't read value of "for" attribute, if i'm rename this attribute, all is work
Reported by: | leadaxe | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.5 |
Component: | manipulation | Version: | 1.4.2 |
Keywords: | attr | Cc: | paulirish, kswedberg |
Blocked by: | Blocking: |
Description
bug demo example: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <div for="test" id="myId"></div> <div fortest="test" id="myId2"></div> <script>$(function(){
alert('$("#myId").attr("for") is "'+$("#myId").attr("for")+'"'); alert('$("#myId2").attr("fortest") is "'+$("#myId2").attr("fortest")+'"');
});</script>
Attachments (1)
Change History (5)
comment:1 Changed 13 years ago by
Changed 12 years ago by
Attachment: | test-6392.html added |
---|
comment:3 Changed 12 years ago by
This is because the "for" property when used in HTML is actually "htmlFor", for example in the label element. That would be true of any of the special cases in jQuery.props I suspect. XML documents don't get this special treatment so "for" would be "for" there. I'm not sure whether this is worth fixing, or just documenting.
comment:4 Changed 12 years ago by
Cc: | paulirish kswedberg added |
---|---|
Milestone: | 1.4.2 → 1.5 |
Priority: | → low |
Resolution: | → wontfix |
Status: | new → closed |
Type: | bug → enhancement |
+1 for documenting.
Closing the ticket as it is not a bug, but cc'ing people who <3 documentation.
div
s don't havefor
attributes--onlylabel
s: http://www.w3.org/TR/REC-html40/interact/forms.html#adef-for