Created
July 25, 2010 14:11
-
-
Save aarongustafson/489588 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createElementWithName(type, name) { | |
var element; | |
// First try the IE way; if this fails then use the standard way | |
if (document.all) { | |
element = | |
document.createElement('< '+type+' name="'+name+'" />'); | |
} else { | |
element = document.createElement(type); | |
element.setAttribute('name', name); | |
} | |
return element; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var oAnchor = document.createElement("<A NAME='AnchorName'></A>"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<<input name="company" /> id="company" maxlength="255" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<INPUT id=company maxLength=255> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var inpt = document.createElement('input'); | |
inpt.setAttribute('name', 'company'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment