zepto
zepto copied to clipboard
$.attr() handles boolean properties wrongly
$el.attr({checked: true})
results in the following html <input checked="true">
which is not allowed in HTML5.
jquery handles this case correctly. jquery: https://codepen.io/phmitterer/pen/QvBXgE?editors=1111 zepto: https://codepen.io/phmitterer/pen/KmBjmN?editors=1111
use the prop()
It would probably be good to handle this the same way as jQuery does.
I'm working on a PR for this issue. But instead of doing it like jQuery, which results in <input checked="checked">
, I think it ought to be <input checked>
. The first form is "non-standard" according to MDN.
This wouldn't break compatibility as long as we return the correct value from $('input').attr('checked')
. Thoughts?