The reproduction is as follows:
Copy codeThe Code is as follows: <! Doctype html>
<Html>
<Head>
<Title> after the document. designMode of iframe is set, only the body. innerHTML in Firefox is br. </title>
<Meta charset = "UTF-8">
</Head>
<Body>
<Iframe frameborder = "1" style = "height: 330px;"> </iframe>
<Script>
Var ifr = document. getElementsByTagName ('iframe') [0];
Var doc = ifr.content##doc ument;
Function prif (){
Lele.log(ifr.content+doc ument. body. innerHTML );
}
Function changeDesignMode (){
Ifr.content+doc ument. designMode = 'on ';
}
Prif ();
</Script>
</Body>
</Html>
The above Code does not contain any html tag in the body of iframe. In normal conditions, ifr.content20.doc ument. body. innerHTML should be a null string. But Firefox is a bit special.
Follow these steps.
Open the html in Firefox and an empty string is output by default.
Run the changeDesignMode method in the console, and then run the prif method. The output innerHTML is "<br>", as shown below:
Chrome/Safari/Opera still outputs a null string.