mercredi 23 août 2017

changing element value with event onkeyup() javascript

Please help me with my script. I don't understand why my script does not working :(

    <html>
    <body>
    <input type="text" id="input" onkeypress="myFunction()">
    <input type="button" value="Hallo" id="but">
    <script>
    function myFunction{
        document.getElementById('but').value = "changed";
    }
    </script>
    </body>
    </html>




Aucun commentaire:

Enregistrer un commentaire