Home > Article > Web Front-end > Some problems and solutions in IE DOM implementation_javascript skills
To summarize, it is mainly in the following two aspects:
1. In IE, the script cannot use setAttribute() to set its style information (css). It must use element.style.property=value (Note: here value is value to be set) to achieve the rendering effect of an element.
eg.document.getElementById("id").style.fontweight="normal";
2.IE does not support setAttribute() to set its response event, although this is supported in the W3c standard. The solution is to use notation to reference the handler that responds to the event, and then call the anonymous function of the relevant handler function to set the event program.
eg.document.getElementById("id").onclick=function (){ deal_with_onclick() };
Note: deal_with_onclick() is the processing function of the onclick event.