Let's talk about common javascript errors and solutions, and common javascript errors.
Javascript beginners are always suffering from minor problems for half a day. There are several minor problems tonight.
First, double quotation marks are used to cause a matching error.
<input type="checkbox" onmouseover="document.getElementById("test").style.display="none":"/>
The error "unexpected toke"} "has been reported for a long time. The error was not found after the check.
<input type="checkbox" onmouseover="document.getElementById('test').style.display="none":"/>
After being changed to single quotes, the error was finally eliminated, which bothered me for one night .. Attached link http://www.cnblogs.com/chinabc/archive/2010/11/19/1881947.html
Second, add a semicolon for an error.
<div id="test" class="test1" onmouseover="toYellow()" ;onmouseout="toRed()";>change</div>
Write a semicolon to avoid executing the code after the semicolon.
Third: Write braces after the function name
<script> function toYellow(){ document.getElementById("test").className="test2"; } function toRed(){ document.getElementById("test").className="test1"; } document.getElementById("test").onmouseover=toYellow(); document.getElementById("test").onmouseout=toRed(); </script>
But the brackets after toYellow () and toRed () are removed and executed normally.
Fourth: Modify the checked attribute of the checkbox
Use the three buttons to select all, all, and invert the checkbox.
<! DOCTYPE html>
The common javascript errors and solutions mentioned above are all the content that I have shared with you. I hope you can give us a reference and support the help house.