Skip to content

Conversation

escoberik
Copy link

Checkable inputs need the property "checked" to be settled to
true/false instead of the "value" attribute.

Checkable inputs need the property "checked" to be settled to
true/false instead of the "value" attribute.
@gabetax
Copy link

gabetax commented Mar 22, 2013

Array#indexOf is not supported in IE8 and earlier. Given that backbone relies on underscore.js, you could instead rely on _.contains() (note the nativeIndexOf check):

  $.fn.isCheckable = function() {
    return _.contains(["checkbox", "radio"], this.attr("type"));
  };

Otherwise, 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants