The problem of select control in Mozilla and opera

Source: Internet
Author: User
Tags cdata net
select| Control | Problem 1. Both Mozilla and opera do not support this font, and getting rid of the DTD is ineffective. The test is displayed as Arial font under Mozilla Firefox1.5, Opera9.0. and special symbols are supported.

Such as:
<body id= "Www.never-online.net" >
<div style= "Font-family:webdings" >6</div>
<div> </div>
</body>
Can be opened in different browsers, you can see the difference, the previous webdings fonts are not commonly used to find this problem, so it is better to do these pictures later.

2. Option to add select Controls in IE and opera so you can <select id= "sel" >
</select>
<script type= "Text/javascript" >
<! [cdata[
var A=document.getelementbyid ("Sel");
var o=new Option ("Never-online.net", "a", false,false);
A.add (o);
]]>
</script>
But under Mozilla it is a failure and will throw an exception. What if you dynamically add option to the Select control in Mozilla? That's all you need.
<select id= "SEL" >
</select>
<script type= "Text/javascript" >
<! [cdata[
var A=document.getelementbyid ("Sel");
var o=new Option ("Never-online.net", "a", false,false);
A.options.add (o);
]]>
</script>a.options.add (o); it's not like in IE, you can add option directly to a Select control object, and you want to add option to the Options object. Therefore, it is also possible to see from this point that Mozilla requires written code is very strict.

3. Similarly, when you delete, you use the Remove method, but instead of deleting option on the Options object, you do the action on the Select Control object. Code <select id= "SEL" >
</select>
<script type= "Text/javascript" >
<! [cdata[
var A=document.getelementbyid ("Sel");
var o=new Option ("Never-online", "a", false,false);
A.options.add (o);
Alert ("You can see this option added Never-online");
A.remove (0);
Alert ("Delete the added option now");
]]>
</script>

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.