Created
August 15, 2018 08:23
-
-
Save omernaci/b1a66bf6a5af90a39ca4bc9007fdf070 to your computer and use it in GitHub Desktop.
call a function with arguments
This file contains 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
<!DOCTYPE html> | |
<html> | |
<body> | |
<p>Click "Try it" to call a function with arguments</p> | |
<button onclick="myFunction('Harry Potter','Wizard')">Try it</button> | |
<p id="demo"></p> | |
<script> | |
function myFunction(name,job) { | |
document.getElementById("demo").innerHTML = | |
"Welcome " + name + ", the " + job + "."; | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment