Closed Calvein closed 12 years ago
The spec allow the value
attribute only on <li>
in <ol>
s and <data>
.
I have fix my problem on the <data>
by doing this because bonzo doesn't check the case sensitivity on specialAttributes
: $('data').attr('Value')
@Calvein can you write a test or two for it? Just fiddling in Chrome I can see that (<data>).value
gives undefined while (<data>).getAttribute('value')
gives the attribute value which is where attr()
is tripping up for you but <li>
seems to work OK wtih just .value
(or ['value']
). Would be good to see it across browsers.
Would also be good to fix the case sensitivity thing too, perhaps a toLowerCase()
rather than fixing the regex cause I think the spec wants lower case attribute keys anyway?
In IE8 li.value
or li['value']
returns a boolean not the correct value.
For the case sensitivity issue, we may just add an i
at the end of the specialAttributes
variable: /^checked|value|selected$/i
I'll do the test later :)
hey there @Calvein — i'm going through some old requests, if you'd like this one in, would you mind isolating your edits to src/bonzo.js
and of course, keep your added tests? as it stands it conflicts with master. cc @rvagg
I think it would be better to wait for the <data>
element to be in the spec (http://dev.w3.org/html5/spec/the-data-element.html) and not only in the whatwg (http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-data-element), I'm not sure if it will stay because of the come back of the <time>
element.
this more than likely happens on all HTML5 elements.. :/