Q:

Basic troubleshooting, Function onclick will not work

            <!DOCTYPE html>
            <html>
            <head>
            <title>Practice with condition statements.</title>
            <script LANGUAGE="Javascript" type="text/javascript">
            function myFunction()
            {
            if (document.getElementById(input1).value == John);
                    {
                        alert("This is correct!");
                    }
            else
                    }
                        alert("This is incorrect!");
                    }
            }
            </script>
            </head>

            <body bgcolor="green">
            Answer:<input type="text" name="answer" id="input1">
            <button type="button" onclick="myFunction()">Submit</button>
            </body>
            </html>

I cannot for the life of me figure out why this function will not display alert messages. I've messed with it for at least an hour and a half and it is giving me a headache. I hope this isn't some easy fix that has been eluding my eyes. I am very new at this so please be gentle with any criticism. :C

A:

input1 is not a variable or object, You must wrap it in "doublequotes" or 'singlequotes'. Use:
document.getElementById("input1").value

instead of:
document.getElementById(input1).value

