Reputation: 1413
This is my javascript function that is working in chrome and FF5 but not working in IE.
function createContorl() {
var parentDiv = document.createElement("div");
parentDiv.setAttribute("class", "ModelProgressDiv");
parentDiv.setAttribute("Id", "ProgressDiv");
var innerContent = document.createElement("div");
innerContent.setAttribute("class", "ModalProgressDivContent");
var img = document.createElement("img");
img.setAttribute("src", "images/loading_large.gif");
parentDiv.appendChild(innerContent);
innerContent.appendChild(img);
document.body.appendChild(parentDiv);
}
Upvotes: 0
Views: 270
Reputation: 944568
setAttribute
is broken in IE unless you are using a very recent version in Standards Mode. It sets properties instead of attributes so it fails when the property doesn't have the same name as the attribute. Don't use it.
parentDiv.className = "ModelProgressDiv"; // etc
Upvotes: 2