The following is a very simple HTML code that looks the same at both ends:
{
This. style. display = 'none'; document. getelementbyid ('Code _ closed_text_110924 '). style. display = 'none'; document. getelementbyid ('Code _ open_image_110924 '). style. display = 'inline'; document. getelementbyid ('Code _ open_text_110924 '). style. display = 'inline ';
} "Id =" code_closed_image_110924 "style =" display: none "> {
This. style. display = 'none'; document. getelementbyid ('Code _ open_text_110924 '). style. display = 'none'; getelementbyid ('Code _ closed_image_110924 '). style. display = 'inline'; getelementbyid ('Code _ closed_text_110924 '). style. display = 'inline ';
} "Id =" code_open_image_110924 "> code
<Ul id = "mylist"> <li> 1 </LI>
<Li> 2 </LI>
<Li> 3 </LI>
<Li> 4 </LI>
<Li> 5 </LI>
<Li> 6 </LI>
</Ul>
{
This. style. display = 'none'; document. getelementbyid ('Code _ closed_text_110915 '). style. display = 'none'; document. getelementbyid ('Code _ open_image_110915 '). style. display = 'inline'; document. getelementbyid ('Code _ open_text_110915 '). style. display = 'inline ';
} "Id =" code_closed_image_110915 "style =" display: none "> {
This. style. display = 'none'; document. getelementbyid ('Code _ open_text_110915 '). style. display = 'none'; getelementbyid ('Code _ closed_image_110915 '). style. display = 'inline'; getelementbyid ('Code _ closed_text_110915 '). style. display = 'inline ';
} "Id =" code_open_image_110915 "> code
<Ul id = "mylist">
<Li> 1 </LI>
<Li> 2 </LI>
<Li> 3 </LI>
<Li> 4 </LI>
<Li> 5 </LI>
<Li> 6 </LI>
</Ul>
However, when we use
{
This. style. display = 'none'; document. getelementbyid ('Code _ closed_text_111031 '). style. display = 'none'; document. getelementbyid ('Code _ open_image_111031 '). style. display = 'inline'; document. getelementbyid ('Code _ open_text_111031 '). style. display = 'inline ';
} "Id =" code_closed_image_111031 "style =" display: none "> {
This. style. display = 'none'; document. getelementbyid ('Code _ open_text_111031 '). style. display = 'none'; getelementbyid ('Code _ closed_image_111031 '). style. display = 'inline'; getelementbyid ('Code _ closed_text_111031 '). style. display = 'inline ';
} "Id =" code_open_image_111031 "> code
VaR ou = Document. getelementbyid ("mylist ");
Alert (ou. firstchild. nodetype)
During the test, we found that:
In ie, the result is 1;
In ff, the first is: 1, and the second is 3;
This problem occurs because Firefox considers meaningless spaces and carriage returns as a text node.