Js: differences between IE and DOM browsers

Source: Internet
Author: User
If you use JavaScript to add the form Element & lt; input & gt; to the table, & lt; form & gt; input & gt; included

There is a problem with IE processing the end tag in the form of "/>. As shown in the following section:

 

If you use JavaScript to add form elements to a table, You will find in IE "! It can be seen how bad IE is dealing with this situation. This is not the case in FireFox.

The DOM model of IE cannot be set.

The DOM model of IE cannot be correctly created. The following JavaScript code:

var radio = document.createElement(‘input’);radio.setAttribute(‘type’, ‘radio’);radio.setAttribute(‘name’, name);radio.setAttribute(“value”, value);

If you place the created ticket on the page, you cannot select the ticket in IE. FireFox does not have this problem. The solution is:

function createRadio(name, value) {if (navigator.appName.indexOf(“Microsoft”) != -1) {var radio = document.createElement(‘’);radio.value = value;return radio;} else {var radio = document.createElement(‘input’);radio.setAttribute(‘type’, ‘radio’);radio.setAttribute(‘name’, name);radio.setAttribute(“value”, value);return radio;}}
The innerHTML of the element. You can see in the DHTML reference document that IE recommends using insertRow and other methods to operate table content, while using table. innerHTML =... An error is reported in IE. FireFox does not have this problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.