Question: Calling Functions function buttonReport(buttonId, buttonName, buttonValue) { //information about the id of the button var userMessage1 = Button id: + buttonId + ; //about
function buttonReport(buttonId, buttonName, buttonValue) {
//information about the id of the button
var userMessage1 = "Button id:" + buttonId + " ";
//about the button name
var userMessage2 = "Button name:" + buttonName + " ";
// and the button value
var userMessage3= "Button value:" +buttonValue + " ";
//alart the user
alart(userMessage1 + userMessage2 +userMessage3) ;
}
onclick= "buttonReport(this.id,this.name,this.value)" />
Onclick="buttonReport(this.id,this.name,this.value)" />
onclick="buttonReport(this.id,this.name,this.value)" />
In the lecture, we have learned by creating a function that can send the user a message about a button he or she has just clicked. We place the function definition in the
section of the page and call it with multiple arguments. Lets practice a hands-on exercise by creating the script listed in the following in your text editor, save it as functioncall.html,Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
