Create a new document, input the content, and rename it ".
1:<Textarea ID= "QQ"> </Textarea>
2:<Script>
3:// Document. getelementbyid ("QQ"). value = '000000 ';
4:Document. getelementbyid ("QQ"). Innerhtml ='Sfsdfsdfsfaf';
5:Document. getelementbyid ("QQ"). Value ='123';
6:// The innerhtml and value of the "QQ" node are displayed.
7:Alert ("Innerhtml :"+ Document. getelementbyid ("QQ"). Innerhtml +"Value :"+ Document. getelementbyid ("QQ"). Value );
8:</Script>
1. assign values to innerhtml first, and then assign values to value
Open with IE 7 and the result is as follows:
Open it with Firefox 4.0.1 and the result is as follows:
Open chrome 10.0.648.204 with the same result as Firefox:
2.CodeComment out the fifth line in, and the results in the three browsers are the same:
3. Cancel the comments on the third line. The result is as follows:
Conclusion: ◎ assign values to innerhtml and value to value. In IE 7, the value will overwrite the innerhtml value, but will not be overwritten in Firefox 4 and chrome 10.
◎ Assign values only to innerhtml and not to value. The three browsers automatically assigned the innerhtml value to the value.
◎ Assign values first, and then assign values to innerhtml. In Firefox 4, The innerhtml value does not overwrite the value, and the other two Browsers Do Not.