Created
March 16, 2017 19:19
-
-
Save SebDeclercq/2a5032c729a4dd300e5be8f02f6a50fc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <body> | |
| <script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script> | |
| <script> | |
| function Personne(prenom, nom) { | |
| this.nom = nom | |
| this.prenom = prenom | |
| this.say = function(verbe='Hello') { | |
| alert(verbe+' '+this.prenom+' '+this.nom.toUpperCase()) | |
| } | |
| } | |
| </script> | |
| <script> | |
| $(document).ready(function() { | |
| $("#submit").on('click', function() { | |
| var pers = new Personne( | |
| $("input[name=nom]").val(), | |
| $("input[name=prenom]").val() | |
| ) | |
| pers.say() | |
| }) | |
| }) | |
| </script> | |
| <input type="text" name="nom" placeholder="nom"/><br/> | |
| <input type="text" name="prenom" placeholder="prenom"/><br/> | |
| <button id="submit">new</button> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment