Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added 'formattribute' test

Fixes #639
  • Loading branch information...
commit fb75a4429d8f5c6d6b852a908c9d9e0b2d7de480 1 parent 0941909
@danielchatfield danielchatfield authored
Showing with 27 additions and 0 deletions.
  1. +27 −0 feature-detects/forms-formattribute.js
View
27 feature-detects/forms-formattribute.js
@@ -0,0 +1,27 @@
+
+
+// Detects whether input form="form_id" is available on the platform
+// E.g. IE 10 (and below), don't support this
+
+Modernizr.addTest("formattribute", function(){
+ var form = document.createElement("form"),
+ input = document.createElement("input"),
+ div = document.createElement("div"),
+ id = "formtest",
+ bool = false;
+
+ form.id = id;
+ input.setAttribute("form",id);
+
+ div.appendChild(form);
+ div.appendChild(input);
+
+ document.documentElement.appendChild(div);
+
+ bool = form.elements.length === 1;
+
+ div.parentNode.removeChild(div);
+
+ return bool;
+
+});
Please sign in to comment.
Something went wrong with that request. Please try again.