Today’s technical tidbit

The following code fragment works fine in Firefox but fails in IE:

myform.appendChild(tags);
tag = document.createElement("input");
tag.name = "button";
tag.value = "Tag";
tag.type = "submit";

But reordering it to set the type before the value works fine in both browsers. To play it safe, I decided to set the type immediately after creating the element.

myform.appendChild(tags);
tag = document.createElement("input");
tag.type = "submit";
tag.name = "button";
tag.value = "Tag";

This entry was posted in Computer Stuff. Bookmark the permalink.

Comments are closed.