We can see that the onclick is different in this example than the last one. The onclick="sampleFunction(' Test Argument ')" now has a argument it is adding into the sampleFunction(). The argument ' Test Argument ' is passed into the function sampleFunction(), and the argument1 now takes the value of the ' Test Argument '. As we begin through the function, we are told to alert our new argument, argument1. The message that pops up is "Test Argument".
Another way to call a function is to call it from another method or function:
Your code will execute in this window.
Let's explore some more tutorials or topics!
No comments yet... Be the first!