Home >Web Front-end >JS Tutorial >When modifying the batch beautification select to be sent and modifying the select, I found several problems under non-IE_form effects

When modifying the batch beautification select to be sent and modifying the select, I found several problems under non-IE_form effects

WBOY
WBOYOriginal
2016-05-16 19:21:51758browse

Problems discovered may be added one after another
1. Neither Mozilla nor Opera supports this font, and changing the DTD has no effect. The test shows that the Arial font is displayed under Mozilla Firefox1.5 and Opera9.0. And special symbols are supported.

For example:


6



can be opened in different browsers, You can see the difference. Webdings fonts were not commonly used in the past, but I only discovered this problem now, so it will be better to use pictures for these in the future.

2. Add the option of the select control in IE and Opera, you can do this



But in It fails under Mozilla and will throw an exception. What if you dynamically add the Option of the select control in Mozilla? Just do this



a.options.add(o); This sentence means that unlike in IE, you can add it directly to the select control object option, and option needs to be added to the options object, so it can also be seen from this that Mozilla is very strict in writing code.
3. Similarly, when deleting, use the remove method

<script> <BR>//<![CDATA[ <BR>var a=document.getElementById("sel"); <BR>var o=new Option("never-online.net","a",false,false); <BR>a.add(o); <BR>//]]> <BR></script><script> <BR>//<![CDATA[ <BR>var a=document.getElementById("sel"); <BR>var o=new Option("never-online.net","a",false,false); <BR>a.options.add(o); <BR>//]]> <BR></script> <script> <BR>//<![CDATA[ <BR>var a=document.getElementById("sel"); <BR>var o=new Option("never-online","a",false,false); <BR>a.options.add(o); <BR>alert("你可以看到添加了never-online这个option"); <BR>a.remove(0); <BR>alert("现在删除添加的option"); <BR>//]]> <BR></script>
Statement:
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