mardi 29 mars 2016

How to compare Input value HTML in script

Here is my code. Basically im doing HTML. I put an input for username and password. Now i want to compare the input and the specific value. We need to do in Script. SO my question is, what is the code at the button to compare the specific value and the User Input.The result will display the "database.html" Thank you.

Key in

    <input type =" text" id=" name" ><br>

    <button onclick=getElementbyId('database.html')> Hi</button>

    <script>
        function myFunction()
        if name = "Danial"{

              open database.html
        }

    </script>

</body>

Aucun commentaire:

Enregistrer un commentaire