Home Web Front-end JS Tutorial Some problems and solutions in IE DOM implementation_javascript skills

Some problems and solutions in IE DOM implementation_javascript skills

May 16, 2016 pm 06:49 PM
dom ie

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.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What should I do if win11 cannot use ie11 browser? (win11 cannot use IE browser) What should I do if win11 cannot use ie11 browser? (win11 cannot use IE browser) Feb 10, 2024 am 10:30 AM

What should I do if win11 cannot use ie11 browser? (win11 cannot use IE browser)

Internet Explorer opens Edge: How to stop MS Edge redirection Internet Explorer opens Edge: How to stop MS Edge redirection Apr 14, 2023 pm 06:13 PM

Internet Explorer opens Edge: How to stop MS Edge redirection

What are the ways to obtain DOM nodes in Vue3 What are the ways to obtain DOM nodes in Vue3 May 11, 2023 pm 04:55 PM

What are the ways to obtain DOM nodes in Vue3

How to cancel the automatic jump to Edge when opening IE in Win10_Solution to the automatic jump of IE browser page How to cancel the automatic jump to Edge when opening IE in Win10_Solution to the automatic jump of IE browser page Mar 20, 2024 pm 09:21 PM

How to cancel the automatic jump to Edge when opening IE in Win10_Solution to the automatic jump of IE browser page

The end of an era: Internet Explorer 11 is retired, here's what you need to know The end of an era: Internet Explorer 11 is retired, here's what you need to know Apr 20, 2023 pm 06:52 PM

The end of an era: Internet Explorer 11 is retired, here's what you need to know

How to solve the problem that IE shortcut cannot be deleted How to solve the problem that IE shortcut cannot be deleted Jan 29, 2024 pm 04:48 PM

How to solve the problem that IE shortcut cannot be deleted

DOM manipulation guide in PHP DOM manipulation guide in PHP May 21, 2023 pm 04:01 PM

DOM manipulation guide in PHP

What does vue dom mean? What does vue dom mean? Dec 20, 2022 pm 08:41 PM

What does vue dom mean?

See all articles