Beginners JavaScript, every day is always a small problem for a long time, tonight there are several small problems.
First: Use double quotes all to create a matching error
<input type= "checkbox" onmouseover= "document.getElementById (" Test "). Style.display=" None ":"/>
The change has been reported error: unexpected Toke "}" check for half a day did not find errors, the control found that the video is using single quotation marks
<input type= "checkbox" onmouseover= "document.getElementById (' Test '). style.display=" None ":"/>
After changing to single quotation marks, the mistake finally eliminated, troubled me one night. Attached link http://www.cnblogs.com/chinabc/archive/2010/11/19/1881947.html
Second: Error adding semicolon
<div id= "test" class= "Test1" onmouseover= "Toyellow ()"; onmouseout= "tored ()";>change</div>
Write a semicolon, resulting in the code after the semicolon does not execute
Third: Write more parentheses after the function name
<script>function Toyellow () { document.getElementById ("test"). Classname= "Test2";} function tored () { document.getElementById ("test"). Classname= "Test1";} document.getElementById ("Test"). Onmouseover=toyellow ();d Ocument.getelementbyid ("test"). Onmouseout=tored ();< /script>
Toyellow () and tored () after the parentheses are executed normally
IV: Checked Property modification of checkbox
Use three buttons to select all, select, and reverse the checkbox.
<! DOCTYPE html>
Common JavaScript errors