We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In IE < 9, the following is legal:
var e = document.createElement("<input name='foo'></div>");
Indeed, it's the only way to create an element with a name property on older versions of IE.
name
In Firefox, Chrome, Safari, Opera, and IE 9, it's not. The proper way to do that is:
var e = document.createelement('input'); e.setAttribute('name', 'foo');
I'd love to have a test for old-style IE createElement support:
Modernizr.addTest('htmlCreateElement', function() { var result; try { document.createElement("<input name='test' />"); result = true; } catch(e) { result = false; } return result; });
The text was updated successfully, but these errors were encountered:
how about
document.createElement("<input name='test' />"); result = true;
changes to
return document.createElement("<input name='test' />").getAttribute('name') == 'test';
Sorry, something went wrong.
The problem is that document.createElement("<input name='test' />") will throw an exception on everything except IE6-8. We could do
document.createElement("<input name='test' />")
try { return document.createElement("<input name='test' />").getAttribute('name') == 'test'; } catch(e) { return false; }
yup! that's what i meant. :)
13d4566
<input name='test' /> test. fixes Modernizr#258
<input name='test' />
cb02032
No branches or pull requests
In IE < 9, the following is legal:
Indeed, it's the only way to create an element with a
name
property on older versions of IE.In Firefox, Chrome, Safari, Opera, and IE 9, it's not. The proper way to do that is:
I'd love to have a test for old-style IE createElement support:
The text was updated successfully, but these errors were encountered: